/
bail-and-watch-warning.test.js
26 lines (19 loc) · 1.09 KB
/
bail-and-watch-warning.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'use strict';
const { run } = require('../utils/test-utils');
describe('bail and watch warning', () => {
it('should log warning in case of single compiler', () => {
const { stderr, stdout } = run(__dirname, ['-c', 'single-webpack.config.js']);
expect(stderr).toContain(`You are using "bail" with "watch". "bail" will still exit webpack when the first error is found.`);
expect(stdout).toBeTruthy();
});
it('should log warning in case of multiple compilers', () => {
const { stderr, stdout } = run(__dirname, ['-c', 'multi-webpack.config.js']);
expect(stderr).toContain(`You are using "bail" with "watch". "bail" will still exit webpack when the first error is found.`);
expect(stdout).toBeTruthy();
});
it('should log not log warning if both are not true', () => {
const { stderr, stdout } = run(__dirname, ['-c', 'third-webpack.config.js']);
expect(stderr).not.toContain(`You are using "bail" with "watch". "bail" will still exit webpack when the first error is found.`);
expect(stdout).toBeTruthy();
});
});