-
-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa0cf25
commit 3c8628c
Showing
3 changed files
with
19 additions
and
13 deletions.
There are no files selected for viewing
8 changes: 5 additions & 3 deletions
8
test/binCases/errors/clean-webpack-options/clean-webpack-options.test.js
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,19 +1,21 @@ | ||
"use strict"; | ||
|
||
const { run } = require("../../../testUtils"); | ||
const { run, extractSummary } = require("../../../testUtils"); | ||
|
||
test("clean-webpack-options", () => { | ||
const { code, stdout, stderr } = run(__dirname, []); | ||
|
||
const summary = extractSummary(stdout); | ||
|
||
expect(code).toBe(1); | ||
|
||
expect(stdout).toHaveLength(0); | ||
expect(summary).toHaveLength(0); | ||
|
||
expect(stderr).toContain("Invalid configuration object."); | ||
expect(stderr).toContain("configuration.context should be a string"); | ||
expect(stderr).toContain("The base directory "); | ||
|
||
expect(stderr.split("\n")).toHaveLength(4); | ||
expect(stdout).toMatchSnapshot(); | ||
expect(summary).toMatchSnapshot(); | ||
expect(stderr).toMatchSnapshot(); | ||
}); |
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,12 +1,14 @@ | ||
"use strict"; | ||
|
||
const { run } = require("../../../testUtils"); | ||
const { run, extractSummary } = require("../../../testUtils"); | ||
|
||
test("info-verbosity", () => { | ||
const { stderr, stdout, code } = run(__dirname, ["a", "bundle.js", "--mode", "production"]); | ||
|
||
const summary = extractSummary(stdout); | ||
|
||
expect(code).toBe(2); | ||
expect(stdout).toContain("bundle.js"); | ||
expect(summary).toContain("bundle.js"); | ||
|
||
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,18 +1,20 @@ | ||
"use strict"; | ||
|
||
const { run } = require("../../../testUtils"); | ||
const { run, extractSummary } = require("../../../testUtils"); | ||
|
||
test("info-verbosity", () => { | ||
const { stderr, stdout, code } = run(__dirname, []); | ||
|
||
const summary = extractSummary(stdout); | ||
|
||
expect(code).toBe(2); | ||
expect(stdout).toContain("./index.js"); | ||
expect(stdout).toContain("[built]"); | ||
expect(stdout).toContain("[failed]"); | ||
expect(stdout).toContain("[1 error]"); | ||
expect(stdout).toContain("ERROR in ./index.js"); | ||
expect(stdout).toContain("Module parse failed:"); | ||
expect(summary).toContain("./index.js"); | ||
expect(summary).toContain("[built]"); | ||
expect(summary).toContain("[failed]"); | ||
expect(summary).toContain("[1 error]"); | ||
expect(summary).toContain("ERROR in ./index.js"); | ||
expect(summary).toContain("Module parse failed:"); | ||
|
||
expect(stderr).toHaveLength(0); | ||
expect(stdout).toMatchSnapshot(); | ||
expect(summary).toMatchSnapshot(); | ||
}); |