11import { normalize } from 'path' ;
22import { createProjectFromAsset } from '../../../utils/assets' ;
33import { exec } from '../../../utils/process' ;
4- import { expectFileToMatch } from '../../../utils/fs' ;
4+ import { expectFileToMatch , rimraf } from '../../../utils/fs' ;
55
66
77export default function ( skipCleaning : ( ) => void ) {
@@ -12,13 +12,20 @@ export default function(skipCleaning: () => void) {
1212 new RegExp ( '.bootstrapModuleFactory' ) )
1313 . then ( ( ) => expectFileToMatch ( 'dist/app.main.js' ,
1414 new RegExp ( 'MyInjectable.ctorParameters = .*'
15- + 'type: .*ViewContainerRef.*'
1615 + 'type: undefined, decorators.*Inject.*args: .*DOCUMENT.*' ) )
1716 . then ( ( ) => expectFileToMatch ( 'dist/app.main.js' ,
1817 new RegExp ( 'AppComponent.ctorParameters = .*MyInjectable' ) )
1918 . then ( ( ) => expectFileToMatch ( 'dist/app.main.js' ,
2019 / A p p M o d u l e \* \/ \] .* \. t e s t P r o p = \' t e s t i n g \' / ) )
2120 . then ( ( ) => expectFileToMatch ( 'dist/app.main.js' ,
22- / r e n d e r M o d u l e F a c t o r y \* \/ \] .* \/ \* A p p M o d u l e N g F a c t o r y \* \/ \] / ) )
21+ / r e n d e r M o d u l e F a c t o r y \* \/ \] .* \/ \* A p p M o d u l e N g F a c t o r y \* \/ \] / ) )
22+ . then ( ( ) => rimraf ( 'dist' ) )
23+ . then ( ( ) => exec ( normalize ( 'node_modules/.bin/webpack' ) ,
24+ '--config' , 'webpack.commonjs.config.js' ) )
25+ . then ( ( ) => expectFileToMatch ( 'dist/app.main.js' ,
26+ / _ _ w e b p a c k _ e x p o r t s _ _ , " A p p M o d u l e N g F a c t o r y " / ) )
27+ . then ( ( ) => exec ( normalize ( 'node' ) , 'index.js' ) )
28+ . then ( ( ) => expectFileToMatch ( 'dist/index.html' ,
29+ new RegExp ( '<a ng-reflect-router-link="lazy" href="/lazy">lazy</a>' ) ) )
2330 . then ( ( ) => skipCleaning ( ) ) ;
2431}
0 commit comments