|
5 | 5 | silentExecAndWaitForOutputToMatch,
|
6 | 6 | ng,
|
7 | 7 | } from '../../utils/process';
|
8 |
| -import {writeFile} from '../../utils/fs'; |
| 8 | +import {writeFile, writeMultipleFiles, appendToFile, expectFileToMatch} from '../../utils/fs'; |
9 | 9 | import {wait} from '../../utils/utils';
|
| 10 | +import {request} from '../../utils/http'; |
10 | 11 |
|
11 | 12 |
|
12 | 13 | export default function() {
|
@@ -69,6 +70,33 @@ export default function() {
|
69 | 70 | throw new Error('Expected webpack to create a new chunk, but did not.');
|
70 | 71 | }
|
71 | 72 | })
|
| 73 | + .then(() => wait(1000)) |
| 74 | + // Change multiple files and check that all of them are invalidated and recompiled. |
| 75 | + .then(() => writeMultipleFiles({ |
| 76 | + 'src/app/app.module.ts': ` |
| 77 | + console.log('$$_E2E_GOLDEN_VALUE_1'); |
| 78 | + export let X = '$$_E2E_GOLDEN_VALUE_2'; |
| 79 | + `, |
| 80 | + 'src/main.ts': ` |
| 81 | + import * as m from './app/app.module'; |
| 82 | + console.log(m.X); |
| 83 | + console.log('$$_E2E_GOLDEN_VALUE_3'); |
| 84 | + ` |
| 85 | + })) |
| 86 | + .then(() => waitForAnyProcessOutputToMatch( |
| 87 | + /webpack: bundle is now VALID|webpack: Compiled successfully./, 10000)) |
| 88 | + .then(() => request('http://localhost:4200/main.bundle.js')) |
| 89 | + .then((body) => { |
| 90 | + if (!body.match(/\$\$_E2E_GOLDEN_VALUE_1/)) { |
| 91 | + throw new Error('Expected golden value 1.'); |
| 92 | + } |
| 93 | + if (!body.match(/\$\$_E2E_GOLDEN_VALUE_2/)) { |
| 94 | + throw new Error('Expected golden value 2.'); |
| 95 | + } |
| 96 | + if (!body.match(/\$\$_E2E_GOLDEN_VALUE_3/)) { |
| 97 | + throw new Error('Expected golden value 3.'); |
| 98 | + } |
| 99 | + }) |
72 | 100 | .then(() => killAllProcesses(), (err: any) => {
|
73 | 101 | killAllProcesses();
|
74 | 102 | throw err;
|
|
0 commit comments