Skip to content

Commit

Permalink
fix: improve warning message for open (#3191)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Apr 15, 2021
1 parent 384c4f5 commit d473fd9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/utils/runOpen.js
Expand Up @@ -73,7 +73,7 @@ function runOpen(uri, options, logger) {
.join(' ')}" arguments`
: ` in "${openTask.options.app}" app`
: ''
}. If you are running in a headless environment, please do not use the "--open" flag or the "open" option.`
}. If you are running in a headless environment, please do not use the "open" option or related flags like "--open", "--open-target", and "--open-app".`
);
});
})
Expand Down
12 changes: 6 additions & 6 deletions test/server/open-option.test.js
Expand Up @@ -676,7 +676,7 @@ describe('"open" option', () => {
wait: false,
});
expect(loggerWarnSpy).toHaveBeenCalledWith(
'Unable to open "http://localhost:8117/" page. If you are running in a headless environment, please do not use the "--open" flag or the "open" option.'
'Unable to open "http://localhost:8117/" page. If you are running in a headless environment, please do not use the "open" option or related flags like "--open", "--open-target", and "--open-app".'
);

loggerWarnSpy.mockRestore();
Expand Down Expand Up @@ -705,7 +705,7 @@ describe('"open" option', () => {
wait: false,
});
expect(loggerWarnSpy).toHaveBeenCalledWith(
'Unable to open "http://localhost:8117/index.html" page. If you are running in a headless environment, please do not use the "--open" flag or the "open" option.'
'Unable to open "http://localhost:8117/index.html" page. If you are running in a headless environment, please do not use the "open" option or related flags like "--open", "--open-target", and "--open-app".'
);

loggerWarnSpy.mockRestore();
Expand Down Expand Up @@ -738,7 +738,7 @@ describe('"open" option', () => {
wait: false,
});
expect(loggerWarnSpy).toHaveBeenCalledWith(
'Unable to open "http://localhost:8117/index.html" page in "google-chrome" app. If you are running in a headless environment, please do not use the "--open" flag or the "open" option.'
'Unable to open "http://localhost:8117/index.html" page in "google-chrome" app. If you are running in a headless environment, please do not use the "open" option or related flags like "--open", "--open-target", and "--open-app".'
);

loggerWarnSpy.mockRestore();
Expand Down Expand Up @@ -771,7 +771,7 @@ describe('"open" option', () => {
wait: false,
});
expect(loggerWarnSpy).toHaveBeenCalledWith(
'Unable to open "http://localhost:8117/index.html" page in "google-chrome" app with "--incognito --new-window" arguments. If you are running in a headless environment, please do not use the "--open" flag or the "open" option.'
'Unable to open "http://localhost:8117/index.html" page in "google-chrome" app with "--incognito --new-window" arguments. If you are running in a headless environment, please do not use the "open" option or related flags like "--open", "--open-target", and "--open-app".'
);

loggerWarnSpy.mockRestore();
Expand Down Expand Up @@ -817,11 +817,11 @@ describe('"open" option', () => {
);
expect(loggerWarnSpy).toHaveBeenNthCalledWith(
1,
'Unable to open "http://localhost:8117/first.html" page in "google-chrome" app with "--incognito --new-window" arguments. If you are running in a headless environment, please do not use the "--open" flag or the "open" option.'
'Unable to open "http://localhost:8117/first.html" page in "google-chrome" app with "--incognito --new-window" arguments. If you are running in a headless environment, please do not use the "open" option or related flags like "--open", "--open-target", and "--open-app".'
);
expect(loggerWarnSpy).toHaveBeenNthCalledWith(
2,
'Unable to open "http://localhost:8117/second.html" page in "google-chrome" app with "--incognito --new-window" arguments. If you are running in a headless environment, please do not use the "--open" flag or the "open" option.'
'Unable to open "http://localhost:8117/second.html" page in "google-chrome" app with "--incognito --new-window" arguments. If you are running in a headless environment, please do not use the "open" option or related flags like "--open", "--open-target", and "--open-app".'
);

loggerWarnSpy.mockRestore();
Expand Down

0 comments on commit d473fd9

Please sign in to comment.