Skip to content

Commit

Permalink
tests: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Jan 27, 2021
1 parent e8ab029 commit cfeb158
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions test/help/help.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,25 +425,31 @@ describe('help', () => {

expect(exitCode).toBe(0);
expect(stderr).toBeFalsy();
expect(stdout).toContain('Usage: webpack --version');
expect(stdout).toContain('Short: webpack -v');
expect(stdout).toContain(

const pureStdout = stripAnsi(stdout);

expect(pureStdout).toContain('Usage: webpack --version');
expect(pureStdout).toContain('Short: webpack -v');
expect(pureStdout).toContain(
"Description: Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands.",
);
expect(stdout).toContain('CLI documentation: https://webpack.js.org/api/cli/.');
expect(pureStdout).toContain('CLI documentation: https://webpack.js.org/api/cli/.');
});

it('should show help information using the "help -v" option', () => {
const { exitCode, stderr, stdout } = run(__dirname, ['help', '-v']);

expect(exitCode).toBe(0);
expect(stderr).toBeFalsy();
expect(stdout).toContain('Usage: webpack --version');
expect(stdout).toContain('Short: webpack -v');
expect(stdout).toContain(

const pureStdout = stripAnsi(stdout);

expect(pureStdout).toContain('Usage: webpack --version');
expect(pureStdout).toContain('Short: webpack -v');
expect(pureStdout).toContain(
"Description: Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands.",
);
expect(stdout).toContain('CLI documentation: https://webpack.js.org/api/cli/.');
expect(pureStdout).toContain('CLI documentation: https://webpack.js.org/api/cli/.');
});

it('should log error for invalid command using the "--help" option', () => {
Expand Down

0 comments on commit cfeb158

Please sign in to comment.