@@ -6,18 +6,16 @@ import {expectFileToMatch} from '../../../utils/fs';
6
6
7
7
export default function ( ) {
8
8
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' ) ;
10
10
11
11
fs . mkdirSync ( './src/app/sub-dir' ) ;
12
12
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' ) )
14
16
. 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 ) )
21
19
22
20
// Try to run the unit tests.
23
21
. then ( ( ) => ng ( 'build' ) ) ;
0 commit comments