@@ -6,18 +6,16 @@ import {expectFileToMatch} from '../../../utils/fs';
66
77export default function ( ) {
88 const root = process . cwd ( ) ;
9- const modulePath = join ( root , 'src' , ' app' , 'app .module.ts') ;
9+ const modulePath = join ( root , 'src/ app/admin/module/module .module.ts' ) ;
1010
1111 fs . mkdirSync ( './src/app/sub-dir' ) ;
1212
13- return ng ( 'generate' , 'component' , 'test-component' , '--module' , 'app.module.ts' )
13+ return Promise . resolve ( )
14+ . then ( ( ) => ng ( 'generate' , 'module' , 'admin/module' ) )
15+ . then ( ( ) => ng ( 'generate' , 'component' , 'other/test-component' , '--module' , 'admin/module' ) )
1416 . then ( ( ) => expectFileToMatch ( modulePath ,
15- / i m p o r t { T e s t C o m p o n e n t C o m p o n e n t } f r o m ' .\/ t e s t - c o m p o n e n t \/ t e s t - c o m p o n e n t .c o m p o n e n t ' / ) )
16-
17- . then ( ( ) => process . chdir ( join ( root , 'src' , 'app' ) ) )
18- . then ( ( ) => ng ( 'generate' , 'component' , 'test-component2' , '--module' , 'app.module.ts' ) )
19- . then ( ( ) => expectFileToMatch ( modulePath ,
20- / i m p o r t { T e s t C o m p o n e n t 2 C o m p o n e n t } f r o m ' .\/ t e s t - c o m p o n e n t 2 \/ t e s t - c o m p o n e n t 2 .c o m p o n e n t ' / ) )
17+ new RegExp ( / i m p o r t { T e s t C o m p o n e n t C o m p o n e n t } / . source +
18+ / f r o m ' ..\/ ..\/ o t h e r \/ t e s t - c o m p o n e n t \/ t e s t - c o m p o n e n t .c o m p o n e n t ' / . source ) )
2119
2220 // Try to run the unit tests.
2321 . then ( ( ) => ng ( 'build' ) ) ;
0 commit comments