diff --git a/test/version/version-external-packages.test.js b/test/version/version-external-packages.test.js index 198da2e6782..47c21ab9be7 100644 --- a/test/version/version-external-packages.test.js +++ b/test/version/version-external-packages.test.js @@ -83,7 +83,7 @@ describe('version flag with external packages', () => { }); it(' should throw error if invalid argument is present with --version flag', () => { - const { stderr, stdout, exitCode } = run(__dirname, ['init', 'abc', '--version'], false); + const { stderr, stdout, exitCode } = run(__dirname, ['init', 'abc', '--version', '--no-color'], false); expect(exitCode).toBe(2); expect(stderr).toContain(`[webpack-cli] Invalid command 'abc'`); @@ -92,7 +92,7 @@ describe('version flag with external packages', () => { }); it(' should throw error if invalid argument is present with version command', () => { - const { stderr, stdout, exitCode } = run(__dirname, ['init', 'abc', 'version'], false); + const { stderr, stdout, exitCode } = run(__dirname, ['init', 'abc', 'version', '--no-color'], false); expect(exitCode).toBe(2); expect(stderr).toContain(`[webpack-cli] Invalid command 'abc'`); @@ -101,7 +101,7 @@ describe('version flag with external packages', () => { }); it(' should throw error if invalid argument is present with -v alias', () => { - const { stderr, stdout, exitCode } = run(__dirname, ['init', 'abc', '-v'], false); + const { stderr, stdout, exitCode } = run(__dirname, ['init', 'abc', '-v', '--no-color'], false); expect(exitCode).toBe(2); expect(stderr).toContain(`[webpack-cli] Invalid command 'abc'`); diff --git a/test/version/version-multi-args.test.js b/test/version/version-multi-args.test.js index 60c4ea21d8e..1051f44ee45 100644 --- a/test/version/version-multi-args.test.js +++ b/test/version/version-multi-args.test.js @@ -23,7 +23,7 @@ describe('version flag with multiple arguments', () => { }); it('throws error if invalid command is passed with version command', () => { - const { stdout, stderr, exitCode } = run(__dirname, ['version', 'abc'], false); + const { stdout, stderr, exitCode } = run(__dirname, ['version', 'abc', '--no-color'], false); expect(exitCode).toBe(2); expect(stdout).not.toContain(pkgJSON.version); @@ -32,7 +32,7 @@ describe('version flag with multiple arguments', () => { }); it('throws error if invalid option is passed with version command', () => { - const { stdout, stderr, exitCode } = run(__dirname, ['version', '--abc'], false); + const { stdout, stderr, exitCode } = run(__dirname, ['version', '--abc', '--no-color'], false); expect(exitCode).toBe(2); expect(stdout).not.toContain(pkgJSON.version); @@ -41,7 +41,7 @@ describe('version flag with multiple arguments', () => { }); it('throws error if invalid command is passed with --version flag', () => { - const { stdout, stderr, exitCode } = run(__dirname, ['--version', 'abc'], false); + const { stdout, stderr, exitCode } = run(__dirname, ['--version', 'abc', '--no-color'], false); expect(exitCode).toBe(2); expect(stdout).not.toContain(pkgJSON.version); @@ -50,7 +50,7 @@ describe('version flag with multiple arguments', () => { }); it('throws error if invalid option is passed with --version flag', () => { - const { stdout, stderr, exitCode } = run(__dirname, ['--version', '--abc'], false); + const { stdout, stderr, exitCode } = run(__dirname, ['--version', '--abc', '--no-color'], false); expect(exitCode).toBe(2); expect(stdout).not.toContain(pkgJSON.version); @@ -59,7 +59,7 @@ describe('version flag with multiple arguments', () => { }); it('throws error if invalid command is passed with -v alias', () => { - const { stdout, stderr, exitCode } = run(__dirname, ['-v', 'abc'], false); + const { stdout, stderr, exitCode } = run(__dirname, ['-v', 'abc', '--no-color'], false); expect(exitCode).toBe(2); expect(stdout).not.toContain(pkgJSON.version); @@ -68,7 +68,7 @@ describe('version flag with multiple arguments', () => { }); it('throws error if invalid option is passed with -v alias', () => { - const { stdout, stderr, exitCode } = run(__dirname, ['-v', '--abc'], false); + const { stdout, stderr, exitCode } = run(__dirname, ['-v', '--abc', '--no-color'], false); expect(exitCode).toBe(2); expect(stdout).not.toContain(pkgJSON.version);