Skip to content

Commit

Permalink
fix: improve descriptions for --no-open and --no-open-target (#3151)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 authored Apr 5, 2021
1 parent dc650e7 commit 09fa827
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ Options:
--no-client-overlay Do not show a full-screen overlay in the browser when there are compiler errors or warnings.
--setup-exit-signals Close and exit the process on SIGINT and SIGTERM.
--no-setup-exit-signals Do not close and exit the process on SIGNIT and SIGTERM.
--open [value] Open the default browser, or optionally specify a browser name.
--open-app <value...> Open specified browser.
--open-target <value...> Open specified route in browser.
--open [value...] Open the default browser.
--no-open Do not open the default browser.
--open-app <value> Open specified browser.
--open-target [value...] Open specified route in browser.
--no-open-target Do not open specified route in browser.
--client-logging <value> Log level in the browser (none, error, warn, info, log, verbose).
--history-api-fallback Fallback to /index.html for Single Page Applications.
--no-history-api-fallback Do not fallback to /index.html for Single Page Applications.
Expand All @@ -108,6 +110,7 @@ Options:
--public <value> The public hostname/ip address of the server.
--firewall [value...] Enable firewall or set hosts that are allowed to access the dev server.
--no-firewall Disable firewall.
--watch-files <value...> Watch static files for file changes.
Global options:
--color Enable colors on console.
Expand Down
4 changes: 3 additions & 1 deletion bin/cli-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ module.exports = {
},
],
description: 'Open the default browser.',
negatedDescription: 'Do not open the default browser.',
},
{
name: 'open-app',
Expand Down Expand Up @@ -176,6 +177,7 @@ module.exports = {
opts.open.target = opts.openTarget;
delete opts.openTarget;
},
negatedDescription: 'Do not open specified route in browser.',
multiple: true,
},
{
Expand Down Expand Up @@ -254,7 +256,7 @@ module.exports = {
type: 'string',
},
],
description: 'Watch static files for file changes',
description: 'Watch static files for file changes.',
multiple: true,
},
],
Expand Down
18 changes: 18 additions & 0 deletions test/cli/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,15 @@ describe('CLI', () => {
.catch(done);
});

it('--no-open', (done) => {
testBin('--no-open')
.then((output) => {
expect(output.exitCode).toEqual(0);
done();
})
.catch(done);
});

it('--open-app google-chrome', (done) => {
testBin('--open-app google-chrome')
.then((output) => {
Expand All @@ -264,6 +273,15 @@ describe('CLI', () => {
.catch(done);
});

it('--no-open-target', (done) => {
testBin('--no-open-target')
.then((output) => {
expect(output.exitCode).toEqual(0);
done();
})
.catch(done);
});

it('--open-target index.html', (done) => {
testBin('--open-target index.html')
.then((output) => {
Expand Down

0 comments on commit 09fa827

Please sign in to comment.