File tree 1 file changed +33
-0
lines changed
tests/legacy-cli/e2e/tests/misc
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
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 ( ! / \s w e b p a c k @ 5 / . test ( stdout ) ) {
17
+ throw new Error ( 'Expected Webpack 5 to be installed.' ) ;
18
+ }
19
+ if ( / \s w e b p a c k @ 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
+ }
You can’t perform that action at this time.
0 commit comments