-
-
Notifications
You must be signed in to change notification settings - Fork 614
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
3c8628c
commit 0ba72c4
Showing
1 changed file
with
16 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
"use strict"; | ||
|
||
const { run } = require("../../../testUtils"); | ||
const { run, extractSummary } = require("../../../testUtils"); | ||
|
||
test("help-output", () => { | ||
const { code, stdout, stderr } = run(__dirname, ["--help"]); | ||
|
||
expect(code).toBe(0); | ||
expect(stdout).toEqual(expect.anything()); | ||
expect(stdout).toMatch(/webpack/); | ||
expect(stdout).toContain("Config options:"); | ||
expect(stdout).toContain("Basic options:"); | ||
expect(stdout).toContain("Module options:"); | ||
expect(stdout).toContain("Output options:"); | ||
expect(stdout).toContain("Advanced options:"); | ||
expect(stdout).toContain("Resolving options:"); | ||
expect(stdout).toContain("Optimizing options:"); | ||
expect(stdout).toContain("Stats options:"); | ||
expect(stdout).toContain("Options:"); | ||
|
||
const summary = extractSummary(stdout); | ||
|
||
expect(summary).toEqual(expect.anything()); | ||
expect(summary).toMatch(/webpack/); | ||
expect(summary).toContain("Config options:"); | ||
expect(summary).toContain("Basic options:"); | ||
expect(summary).toContain("Module options:"); | ||
expect(summary).toContain("Output options:"); | ||
expect(summary).toContain("Advanced options:"); | ||
expect(summary).toContain("Resolving options:"); | ||
expect(summary).toContain("Optimizing options:"); | ||
expect(summary).toContain("Stats options:"); | ||
expect(summary).toContain("Options:"); | ||
expect(stderr).toHaveLength(0); | ||
}); |