Skip to content

Commit 195bcc6

Browse files
test: more
1 parent 05324a2 commit 195bcc6

3 files changed

Lines changed: 45 additions & 1 deletion

File tree

test/build/stats/flags/__snapshots__/stats.test.js.snap.webpack5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exports[`stats flag should log error when an unknown flag stats value is passed:
44
"[webpack-cli] Invalid value 'foo' for the '--stats' option
55
[webpack-cli] Expected: 'none | summary | errors-only | errors-warnings | minimal | normal | detailed | verbose'
66
[webpack-cli] Invalid value 'foo' for the '--stats' option
7-
[webpack-cli] Expected: 'true | false'"
7+
[webpack-cli] Expected: without value or negative option"
88
`;
99

1010
exports[`stats flag should log error when an unknown flag stats value is passed: stdout 1`] = `""`;

test/help/__snapshots__/help.test.js.snap.devServer5.webpack5

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2469,6 +2469,20 @@ CLI documentation: https://webpack.js.org/api/cli/.
24692469
Made with ♥ by the webpack team."
24702470
`;
24712471

2472+
exports[`help should show help information using the "help --cache-type" option when using serve: stderr 1`] = `""`;
2473+
2474+
exports[`help should show help information using the "help --cache-type" option when using serve: stdout 1`] = `
2475+
"Usage: webpack serve --cache-type <value>
2476+
Description: In memory caching. Filesystem caching.
2477+
Possible values: 'memory' | 'filesystem'
2478+
2479+
To see list of all supported commands and options run 'webpack --help=verbose'.
2480+
2481+
Webpack documentation: https://webpack.js.org/.
2482+
CLI documentation: https://webpack.js.org/api/cli/.
2483+
Made with ♥ by the webpack team."
2484+
`;
2485+
24722486
exports[`help should show help information using the "help --cache-type" option: stderr 1`] = `""`;
24732487

24742488
exports[`help should show help information using the "help --cache-type" option: stdout 1`] = `
@@ -2550,6 +2564,20 @@ CLI documentation: https://webpack.js.org/api/cli/.
25502564
Made with ♥ by the webpack team."
25512565
`;
25522566

2567+
exports[`help should show help information using the "help --server-type" option when using serve: stderr 1`] = `""`;
2568+
2569+
exports[`help should show help information using the "help --server-type" option when using serve: stdout 1`] = `
2570+
"Usage: webpack serve --server-type <value>
2571+
Description: Allows to set server and options (by default 'http').
2572+
Possible values: 'http' | 'https' | 'spdy' | 'http2'
2573+
2574+
To see list of all supported commands and options run 'webpack --help=verbose'.
2575+
2576+
Webpack documentation: https://webpack.js.org/.
2577+
CLI documentation: https://webpack.js.org/api/cli/.
2578+
Made with ♥ by the webpack team."
2579+
`;
2580+
25532581
exports[`help should show help information using the "help --stats" option: stderr 1`] = `""`;
25542582

25552583
exports[`help should show help information using the "help --stats" option: stdout 1`] = `

test/help/help.test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,22 @@ describe("help", () => {
245245
expect(normalizeStdout(stdout)).toMatchSnapshot("stdout");
246246
});
247247

248+
it('should show help information using the "help --cache-type" option when using serve', async () => {
249+
const { exitCode, stderr, stdout } = await run(__dirname, ["help", "serve", "--cache-type"]);
250+
251+
expect(exitCode).toBe(0);
252+
expect(normalizeStderr(stderr)).toMatchSnapshot("stderr");
253+
expect(normalizeStdout(stdout)).toMatchSnapshot("stdout");
254+
});
255+
256+
it('should show help information using the "help --server-type" option when using serve', async () => {
257+
const { exitCode, stderr, stdout } = await run(__dirname, ["help", "serve", "--server-type"]);
258+
259+
expect(exitCode).toBe(0);
260+
expect(normalizeStderr(stderr)).toMatchSnapshot("stderr");
261+
expect(normalizeStdout(stdout)).toMatchSnapshot("stdout");
262+
});
263+
248264
it('should show help information using the "help --output-chunk-format" option', async () => {
249265
const { exitCode, stderr, stdout } = await run(__dirname, ["help", "--output-chunk-format"]);
250266

0 commit comments

Comments
 (0)