Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve waring message for open #3191

Merged
merged 2 commits into from
Apr 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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