Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Jul 7, 2021
1 parent 01bb7d9 commit f599493
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 30 deletions.
13 changes: 0 additions & 13 deletions test/help/__snapshots__/help.test.js.snap.devServer3.webpack4
Expand Up @@ -2515,19 +2515,6 @@ CLI documentation: https://webpack.js.org/api/cli/.
Made with ♥ by the webpack team."
`;

exports[`help should show help information using the "help --cache-type" option: stderr 1`] = `""`;

exports[`help should show help information using the "help --cache-type" option: stdout 1`] = `
"Usage: webpack --cache-type <value>
Description: In memory caching. Filesystem caching.

To see list of all supported commands and options run 'webpack --help=verbose'.

Webpack documentation: https://webpack.js.org/.
CLI documentation: https://webpack.js.org/api/cli/.
Made with ♥ by the webpack team."
`;

exports[`help should show help information using the "help --color" option: stderr 1`] = `""`;

exports[`help should show help information using the "help --color" option: stdout 1`] = `
Expand Down
13 changes: 0 additions & 13 deletions test/help/__snapshots__/help.test.js.snap.devServer4.webpack4
Expand Up @@ -2645,19 +2645,6 @@ CLI documentation: https://webpack.js.org/api/cli/.
Made with ♥ by the webpack team."
`;

exports[`help should show help information using the "help --cache-type" option: stderr 1`] = `""`;

exports[`help should show help information using the "help --cache-type" option: stdout 1`] = `
"Usage: webpack --cache-type <value>
Description: In memory caching. Filesystem caching.

To see list of all supported commands and options run 'webpack --help=verbose'.

Webpack documentation: https://webpack.js.org/.
CLI documentation: https://webpack.js.org/api/cli/.
Made with ♥ by the webpack team."
`;

exports[`help should show help information using the "help --color" option: stderr 1`] = `""`;

exports[`help should show help information using the "help --color" option: stdout 1`] = `
Expand Down
12 changes: 8 additions & 4 deletions test/help/help.test.js
@@ -1,6 +1,6 @@
"use strict";

const { run, normalizeStderr, normalizeStdout } = require("../utils/test-utils");
const { run, normalizeStderr, normalizeStdout, isWebpack5 } = require("../utils/test-utils");

describe("help", () => {
it('should show help information using the "--help" option', async () => {
Expand Down Expand Up @@ -245,9 +245,13 @@ describe("help", () => {
it('should show help information using the "help --cache-type" option', async () => {
const { exitCode, stderr, stdout } = await run(__dirname, ["help", "--cache-type"]);

expect(exitCode).toBe(0);
expect(normalizeStderr(stderr)).toMatchSnapshot("stderr");
expect(normalizeStdout(stdout)).toMatchSnapshot("stdout");
if (isWebpack5) {
expect(exitCode).toBe(0);
expect(normalizeStderr(stderr)).toMatchSnapshot("stderr");
expect(normalizeStdout(stdout)).toMatchSnapshot("stdout");
} else {
expect(exitCode).toBe(2);
}
});

it('should show help information using the "help --no-stats" option', async () => {
Expand Down

0 comments on commit f599493

Please sign in to comment.