-
-
Notifications
You must be signed in to change notification settings - Fork 622
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): show help flag when defaults fail (#466)
* fixed test cases * remove unwanted console * fix(254) - addressed PR comments * fix(254) - added requested changes at right place * fix(254) - exit after error exit webpack if defaults are not found fix test cases for no options * fix: require chalk * refactor - addressed PR comments * refactor - addressed PR comments * refactor : remove unwanted keywords * chore(review): format
- Loading branch information
1 parent
372a90e
commit 9475b17
Showing
6 changed files
with
26 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
const defineTest = require("./defineTest"); | ||
|
||
|
||
defineTest( | ||
__dirname, | ||
"init", | ||
|
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,13 +1,9 @@ | ||
"use strict"; | ||
|
||
module.exports = function testAssertions(code, stdout, stderr) { | ||
expect(code).toBe(2); | ||
expect(code).toBe(0); | ||
expect(stdout).toEqual(expect.anything()); | ||
expect(stdout[0]).toContain("Hash: "); | ||
expect(stdout[1]).toContain("Version: "); | ||
expect(stdout[2]).toContain("Time: "); | ||
expect(stdout[4]).toContain(""); | ||
expect(stdout[5]).toContain("ERROR in Entry module not found"); | ||
expect(stdout[6]).toContain(""); | ||
expect(stdout[3]).toContain("Insufficient number of arguments provided"); | ||
expect(stdout[4]).toContain("Alternatively, run `webpack(-cli) --help` for usage info"); | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
"use strict"; | ||
|
||
module.exports = function testAssertions(code, stdout, stderr) { | ||
expect(code).toBe(2); | ||
expect(code).toBe(0); | ||
expect(stdout).toEqual(expect.anything()); | ||
expect(stdout[0]).toContain("Hash: "); | ||
expect(stdout[1]).toContain("Version: "); | ||
expect(stdout[2]).toContain("Time: "); | ||
expect(stdout[4]).toContain(""); | ||
expect(stdout[5]).toContain("WARNING"); | ||
expect(stdout[6]).toContain("The \'mode\' option has not been set"); | ||
expect(stdout[7]).toContain("You can also set it to \'none\'"); | ||
expect(stdout[8]).toContain(""); | ||
expect(stdout[9]).toContain("ERROR in Entry module not found"); | ||
expect(stdout[3]).toContain("Insufficient number of arguments provided"); | ||
expect(stdout[4]).toContain("Alternatively, run `webpack(-cli) --help` for usage info"); | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
"use strict"; | ||
|
||
module.exports = function testAssertions(code, stdout, stderr) { | ||
expect(code).toBe(2); | ||
expect(code).toBe(0); | ||
expect(stdout).toEqual(expect.anything()); | ||
expect(stdout[0]).toContain("Hash: "); | ||
expect(stdout[1]).toContain("Version: "); | ||
expect(stdout[2]).toContain("Time: "); | ||
expect(stdout[4]).toContain(""); | ||
expect(stdout[5]).toContain("ERROR in Entry module not found"); | ||
expect(stdout[6]).toContain(""); | ||
expect(stdout[3]).toContain("Insufficient number of arguments provided"); | ||
expect(stdout[4]).toContain("Alternatively, run `webpack(-cli) --help` for usage info"); | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"use strict"; | ||
|
||
module.exports = function testAssertions(code, stdout, stderr) { | ||
expect(stdout[3]).toContain("Insufficient number of arguments provided"); | ||
}; |