Skip to content

Commit

Permalink
tests: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Feb 1, 2021
1 parent b19d015 commit 0fa244b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/config-format/mjs/mjs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('webpack cli', () => {
env: { WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG: true },
});

if (/Unexpected token/.test(stderr)) {
if (/Error: Not supported/.test(stderr)) {
expect(exitCode).toBe(2);
expect(stdout).toBeFalsy();
} else {
Expand Down
2 changes: 1 addition & 1 deletion test/config-lookup/custom-name/custom-name.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('custom config file', () => {
env: { WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG: true },
});

if (/Unexpected token/.test(stderr)) {
if (/Error: Not supported/.test(stderr)) {
expect(exitCode).toBe(2);
expect(stdout).toBeFalsy();
} else {
Expand Down
2 changes: 1 addition & 1 deletion test/config/defaults/mjs-config/default-mjs-config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Default Config:', () => {
it('Should be able to pick mjs config by default', () => {
const { exitCode, stderr, stdout } = run(__dirname, [], { env: { WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG: true } });

if (/Unexpected token/.test(stderr)) {
if (/Error: Not supported/.test(stderr)) {
expect(exitCode).toEqual(2);
expect(stdout).toBeFalsy();
} else {
Expand Down
8 changes: 6 additions & 2 deletions test/config/error-mjs/config-error.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('config error', () => {

expect(exitCode).toBe(2);

if (!/Unexpected token/.test(stderr)) {
if (!/Error: Not supported/.test(stderr)) {
expect(stderr).toContain('Invalid configuration object');
expect(stderr).toContain(`"development" | "production" | "none"`);
}
Expand All @@ -24,7 +24,11 @@ describe('config error', () => {
});

expect(exitCode).toBe(2);
expect(stderr).toContain('SyntaxError: Unexpected token');

if (!/Error: Not supported/.test(stderr)) {
expect(stderr).toContain('SyntaxError: Unexpected token');
}

expect(stdout).toBeFalsy();
});
});

0 comments on commit 0fa244b

Please sign in to comment.