-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53c1097
commit 83b7ad3
Showing
5 changed files
with
58 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { | ||
killAllProcesses, | ||
waitForAnyProcessOutputToMatch, | ||
silentExecAndWaitForOutputToMatch | ||
} from '../../utils/process'; | ||
import {appendToFile} from '../../utils/fs'; | ||
import {expectToFail, wait} from '../../utils/utils'; | ||
|
||
const webpackGoodRegEx = /webpack: Compiled successfully./; | ||
|
||
export default function() { | ||
return silentExecAndWaitForOutputToMatch('ng', ['serve', '--poll=10000'], webpackGoodRegEx) | ||
// Wait before editing a file. Editing too soon seems to trigger a rebuild. | ||
.then(() => wait(1000)) | ||
.then(() => appendToFile('src/main.ts', 'console.log(1);')) | ||
.then(() => waitForAnyProcessOutputToMatch(webpackGoodRegEx, 12000)) | ||
.then(() => appendToFile('src/main.ts', 'console.log(1);')) | ||
// No rebuilds should occur for a while | ||
.then(() => expectToFail(() => waitForAnyProcessOutputToMatch(webpackGoodRegEx, 6000))) | ||
// But a rebuild should happen roughly within the 10 second window. | ||
.then(() => waitForAnyProcessOutputToMatch(webpackGoodRegEx, 12000)) | ||
.then(() => killAllProcesses(), (err: any) => { | ||
killAllProcesses(); | ||
throw err; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters