-
-
Notifications
You must be signed in to change notification settings - Fork 593
/
bail.test.js
47 lines (34 loc) · 2.01 KB
/
bail.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
'use strict';
const { runWatch, normalizeStderr, normalizeStdout } = require('../../utils/test-utils');
describe('"bail" option', () => {
it('should not log warning in not watch mode without the "watch" option', async () => {
const { stderr, stdout } = await runWatch(__dirname, ['-c', 'watch-webpack.config.js']);
expect(normalizeStderr(stderr)).toMatchSnapshot('stderr');
expect(normalizeStdout(stdout)).toMatchSnapshot('stdout');
});
it('should not log warning without the "bail" option', async () => {
const { stderr, stdout } = await runWatch(__dirname, ['-c', 'no-bail-webpack.config.js', '--watch']);
expect(normalizeStderr(stderr)).toMatchSnapshot('stderr');
expect(normalizeStdout(stdout)).toMatchSnapshot('stdout');
});
it('should not log warning without the "bail" option', async () => {
const { stderr, stdout } = await runWatch(__dirname, ['-c', 'no-bail-webpack.config.js', '--watch']);
expect(normalizeStderr(stderr)).toMatchSnapshot('stderr');
expect(normalizeStdout(stdout)).toMatchSnapshot('stdout');
});
it('should log warning in watch mode', async () => {
const { stderr, stdout } = await runWatch(__dirname, ['-c', 'bail-webpack.config.js', '--watch']);
expect(normalizeStderr(stderr)).toMatchSnapshot('stderr');
expect(normalizeStdout(stdout)).toMatchSnapshot('stdout');
});
it('should log warning in watch mode', async () => {
const { stderr, stdout } = await runWatch(__dirname, ['-c', 'bail-and-watch-webpack.config.js']);
expect(normalizeStderr(stderr)).toMatchSnapshot('stderr');
expect(normalizeStdout(stdout)).toMatchSnapshot('stdout');
});
it('should log warning in case of multiple compilers', async () => {
const { stderr, stdout } = await runWatch(__dirname, ['-c', 'multi-webpack.config.js']);
expect(normalizeStderr(stderr)).toMatchSnapshot('stderr');
expect(normalizeStdout(stdout)).toMatchSnapshot('stdout');
});
});