/
serve.test.js
31 lines (25 loc) · 1 KB
/
serve.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
const { runServe } = require('../../../../test/utils/test-utils');
describe('Serve', () => {
const isWindows = process.platform === 'win32';
// TODO fix me on windows
if (isWindows) {
it('TODO: Fix on windows', () => {
expect(true).toBe(true);
});
return;
}
it('should run with cli', async () => {
const { stderr, stdout } = await runServe([], __dirname);
expect(stderr).toContain('Compilation starting...');
expect(stderr).toContain('Compilation finished');
expect(stdout).toContain('main.js');
expect(stdout).not.toContain('HotModuleReplacementPlugin');
});
it('should work with flags', async () => {
const { stderr, stdout } = await runServe(['--hot'], __dirname);
expect(stderr).toContain('Compilation starting...');
expect(stderr).toContain('Compilation finished');
expect(stdout).toContain('main.js');
expect(stdout).toContain('HotModuleReplacementPlugin');
});
});