Skip to content

Commit 8c9283c

Browse files
authored
tests: add test for --watch flag (#1854)
* tests: add test for --watch flag
1 parent e731b33 commit 8c9283c

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

test/watch/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('watch flag test');

test/watch/watch-flag.test.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
'use strict';
2+
3+
const { runWatch, isWindows } = require('../utils/test-utils');
4+
5+
describe('--watch flag', () => {
6+
if (isWindows) {
7+
it('TODO: Fix on windows', () => {
8+
expect(true).toBe(true);
9+
});
10+
return;
11+
}
12+
13+
it('should watch for file changes', async () => {
14+
const { stdout } = await runWatch({
15+
testCase: __dirname,
16+
args: ['--watch'],
17+
setOutput: false,
18+
outputKillStr: 'main',
19+
});
20+
21+
expect(stdout).toContain('watching files for updates...');
22+
});
23+
});

0 commit comments

Comments
 (0)