Skip to content

Commit d473fd9

Browse files
authored
fix: improve warning message for open (#3191)
1 parent 384c4f5 commit d473fd9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/utils/runOpen.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function runOpen(uri, options, logger) {
7373
.join(' ')}" arguments`
7474
: ` in "${openTask.options.app}" app`
7575
: ''
76-
}. If you are running in a headless environment, please do not use the "--open" flag or the "open" option.`
76+
}. 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".`
7777
);
7878
});
7979
})

test/server/open-option.test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ describe('"open" option', () => {
676676
wait: false,
677677
});
678678
expect(loggerWarnSpy).toHaveBeenCalledWith(
679-
'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.'
679+
'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".'
680680
);
681681

682682
loggerWarnSpy.mockRestore();
@@ -705,7 +705,7 @@ describe('"open" option', () => {
705705
wait: false,
706706
});
707707
expect(loggerWarnSpy).toHaveBeenCalledWith(
708-
'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.'
708+
'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".'
709709
);
710710

711711
loggerWarnSpy.mockRestore();
@@ -738,7 +738,7 @@ describe('"open" option', () => {
738738
wait: false,
739739
});
740740
expect(loggerWarnSpy).toHaveBeenCalledWith(
741-
'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.'
741+
'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".'
742742
);
743743

744744
loggerWarnSpy.mockRestore();
@@ -771,7 +771,7 @@ describe('"open" option', () => {
771771
wait: false,
772772
});
773773
expect(loggerWarnSpy).toHaveBeenCalledWith(
774-
'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.'
774+
'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".'
775775
);
776776

777777
loggerWarnSpy.mockRestore();
@@ -817,11 +817,11 @@ describe('"open" option', () => {
817817
);
818818
expect(loggerWarnSpy).toHaveBeenNthCalledWith(
819819
1,
820-
'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.'
820+
'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".'
821821
);
822822
expect(loggerWarnSpy).toHaveBeenNthCalledWith(
823823
2,
824-
'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.'
824+
'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".'
825825
);
826826

827827
loggerWarnSpy.mockRestore();

0 commit comments

Comments
 (0)