Skip to content

Commit 5e86fc2

Browse files
clydinfilipesilva
authored andcommitted
test: add an experimental Webpack 5 E2E test
1 parent 3740d80 commit 5e86fc2

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { rimraf } from '../../utils/fs';
2+
import { killAllProcesses, ng, silentYarn } from '../../utils/process';
3+
import { ngServe, updateJsonFile } from '../../utils/project';
4+
5+
export default async function() {
6+
// Setup project for yarn usage
7+
await rimraf('node_modules');
8+
await updateJsonFile('package.json', (json) => {
9+
json.resolutions = { webpack: '5.0.0-beta.30' };
10+
});
11+
await silentYarn();
12+
await silentYarn('webdriver-update');
13+
14+
// Ensure webpack 5 is used
15+
const { stdout } = await silentYarn('list', '--pattern', 'webpack');
16+
if (!/\swebpack@5/.test(stdout)) {
17+
throw new Error('Expected Webpack 5 to be installed.');
18+
}
19+
if (/\swebpack@4/.test(stdout)) {
20+
throw new Error('Expected Webpack 4 to not be installed.');
21+
}
22+
23+
// Execute the CLI with Webpack 5
24+
await ng('test', '--watch=false');
25+
await ng('build');
26+
await ng('build', '--prod');
27+
await ng('e2e');
28+
try {
29+
await ngServe();
30+
} finally {
31+
killAllProcesses();
32+
}
33+
}

0 commit comments

Comments
 (0)