-
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.
feat(@angular/cli): add watch flag to serve/e2e (#4749)
This is useful when you don't want the server to rebuild in the middle of something. A good example is when running e2e tests. Especially on larger suites, one would prefer to continue working while the build is tested without compromising tests. This will break tests on #4744. They should be adjusted to add the `--watch` flag since they depend on the live reload behaviour during `ng e2e`.
- Loading branch information
1 parent
121c390
commit 9d29cbc
Showing
9 changed files
with
74 additions
and
6 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
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
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,33 @@ | ||
import { | ||
killAllProcesses, | ||
exec, | ||
waitForAnyProcessOutputToMatch, | ||
silentExecAndWaitForOutputToMatch | ||
} from '../../utils/process'; | ||
import { expectToFail } from '../../utils/utils'; | ||
|
||
|
||
const webpackGoodRegEx = /webpack: bundle is now VALID|webpack: Compiled successfully./; | ||
|
||
export default function () { | ||
if (process.platform.startsWith('win')) { | ||
return Promise.resolve(); | ||
} | ||
|
||
return silentExecAndWaitForOutputToMatch('ng', ['serve'], webpackGoodRegEx) | ||
// Should trigger a rebuild. | ||
.then(() => exec('touch', 'src/main.ts')) | ||
.then(() => waitForAnyProcessOutputToMatch(webpackGoodRegEx, 5000)) | ||
.then(() => killAllProcesses(), (err: any) => { | ||
killAllProcesses(); | ||
throw err; | ||
}) | ||
.then(() => silentExecAndWaitForOutputToMatch('ng', ['serve', '--no-watch'], webpackGoodRegEx)) | ||
// Should not trigger a rebuild when not watching files. | ||
.then(() => exec('touch', 'src/main.ts')) | ||
.then(() => expectToFail(() => waitForAnyProcessOutputToMatch(webpackGoodRegEx, 5000))) | ||
.then(() => killAllProcesses(), (err: any) => { | ||
killAllProcesses(); | ||
throw err; | ||
}) | ||
} |