-
-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(webpack-cli): throw error for invalid args with HelpGroup
- Loading branch information
Showing
9 changed files
with
83 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,18 @@ | ||
'use strict'; | ||
|
||
const { run } = require('../utils/test-utils'); | ||
const outputDescription = 'Output location of the file generated by webpack'; | ||
const createDescription = 'Initialize a new webpack configuration'; | ||
describe('help flag with multiple arguments', () => { | ||
it('outputs info with dashed syntax', () => { | ||
const { stdout, stderr } = run(__dirname, ['--help', '--target', 'browser']); | ||
expect(stdout).toContain(outputDescription); | ||
expect(stderr).toHaveLength(0); | ||
}); | ||
|
||
it('outputs info with multiple arguments using dashes and with precedence', () => { | ||
const { stdout, stderr } = run(__dirname, ['--target', 'browser', '--help']); | ||
expect(stdout).toContain(outputDescription); | ||
expect(stderr).toHaveLength(0); | ||
}); | ||
const { commands } = require('../../packages/webpack-cli/lib/utils/cli-flags'); | ||
const helpHeader = 'The build tool for modern web applications'; | ||
|
||
it('outputs info with multiple commands and with precedence', () => { | ||
const { stdout, stderr } = run(__dirname, ['init', 'help']); | ||
expect(stdout).toContain(createDescription); | ||
expect(stderr).toHaveLength(0); | ||
describe('help cmd with multiple arguments', () => { | ||
commands.forEach((cmd) => { | ||
it(`shows cmd help with ${cmd.name}`, () => { | ||
const { stdout, stderr } = run(__dirname, ['--help', `${cmd.name}`], false); | ||
expect(stdout).not.toContain(helpHeader); | ||
expect(stdout).toContain(`${cmd.name}`); | ||
expect(stdout).toContain(`${cmd.usage}`); | ||
expect(stdout).toContain(`${cmd.description}`); | ||
expect(stderr).toHaveLength(0); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2415,16 +2415,6 @@ | |
regexpp "^3.0.0" | ||
tsutils "^3.17.1" | ||
|
||
"@typescript-eslint/[email protected]": | ||
version "2.26.0" | ||
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.26.0.tgz#063390c404d9980767d76274df386c0aa675d91d" | ||
integrity sha512-RELVoH5EYd+JlGprEyojUv9HeKcZqF7nZUGSblyAw1FwOGNnmQIU8kxJ69fttQvEwCsX5D6ECJT8GTozxrDKVQ== | ||
dependencies: | ||
"@types/json-schema" "^7.0.3" | ||
"@typescript-eslint/typescript-estree" "2.26.0" | ||
eslint-scope "^5.0.0" | ||
eslint-utils "^2.0.0" | ||
|
||
"@typescript-eslint/[email protected]": | ||
version "2.28.0" | ||
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.28.0.tgz#1fd0961cd8ef6522687b4c562647da6e71f8833d" | ||
|
@@ -2445,19 +2435,6 @@ | |
"@typescript-eslint/typescript-estree" "2.28.0" | ||
eslint-visitor-keys "^1.1.0" | ||
|
||
"@typescript-eslint/[email protected]": | ||
version "2.26.0" | ||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.26.0.tgz#d8132cf1ee8a72234f996519a47d8a9118b57d56" | ||
integrity sha512-3x4SyZCLB4zsKsjuhxDLeVJN6W29VwBnYpCsZ7vIdPel9ZqLfIZJgJXO47MNUkurGpQuIBALdPQKtsSnWpE1Yg== | ||
dependencies: | ||
debug "^4.1.1" | ||
eslint-visitor-keys "^1.1.0" | ||
glob "^7.1.6" | ||
is-glob "^4.0.1" | ||
lodash "^4.17.15" | ||
semver "^6.3.0" | ||
tsutils "^3.17.1" | ||
|
||
"@typescript-eslint/[email protected]": | ||
version "2.28.0" | ||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.28.0.tgz#d34949099ff81092c36dc275b6a1ea580729ba00" | ||
|