forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwatch.ts
More file actions
37 lines (32 loc) · 1.19 KB
/
watch.ts
File metadata and controls
37 lines (32 loc) · 1.19 KB
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
import {
killAllProcesses,
exec,
waitForAnyProcessOutputToMatch,
execAndWaitForOutputToMatch
} from '../../utils/process';
import { expectToFail } from '../../utils/utils';
const webpackGoodRegEx = /: Compiled successfully./;
export default function () {
// TODO(architect): This test is behaving oddly both here and in devkit/build-angular.
// It seems to be because of file watchers.
return;
if (process.platform.startsWith('win')) {
return Promise.resolve();
}
return execAndWaitForOutputToMatch('ng', ['serve'], webpackGoodRegEx)
// Should trigger a rebuild.
.then(() => exec('touch', 'src/main.ts'))
.then(() => waitForAnyProcessOutputToMatch(webpackGoodRegEx, 10000))
.then(() => killAllProcesses(), (err: any) => {
killAllProcesses();
throw err;
})
.then(() => execAndWaitForOutputToMatch('ng', ['serve', '--no-watch'], webpackGoodRegEx))
// Should not trigger a rebuild when not watching files.
.then(() => exec('touch', 'src/main.ts'))
.then(() => expectToFail(() => waitForAnyProcessOutputToMatch(webpackGoodRegEx, 10000)))
.then(() => killAllProcesses(), (err: any) => {
killAllProcesses();
throw err;
})
}