@@ -20,8 +20,8 @@ describe('CDK drag-drop schematic', () => {
2020 runner = new SchematicTestRunner ( 'schematics' , require . resolve ( '../../collection.json' ) ) ;
2121 } ) ;
2222
23- it ( 'should create drag-drop files and add them to module' , ( ) => {
24- const tree = runner . runSchematic ( 'drag-drop' , baseOptions , createTestApp ( runner ) ) ;
23+ it ( 'should create drag-drop files and add them to module' , async ( ) => {
24+ const tree = runner . runSchematic ( 'drag-drop' , baseOptions , await createTestApp ( runner ) ) ;
2525 const moduleContent = getFileContent ( tree , '/projects/material/src/app/app.module.ts' ) ;
2626 const files = tree . files ;
2727
@@ -34,23 +34,23 @@ describe('CDK drag-drop schematic', () => {
3434 expect ( moduleContent ) . toMatch ( / d e c l a r a t i o n s : \s * \[ [ ^ \] ] + ?, \r ? \n \s + F o o C o m p o n e n t \r ? \n / m) ;
3535 } ) ;
3636
37- it ( 'should add drag-drop module' , ( ) => {
38- const tree = runner . runSchematic ( 'drag-drop' , baseOptions , createTestApp ( runner ) ) ;
37+ it ( 'should add drag-drop module' , async ( ) => {
38+ const tree = runner . runSchematic ( 'drag-drop' , baseOptions , await createTestApp ( runner ) ) ;
3939 const moduleContent = getFileContent ( tree , '/projects/material/src/app/app.module.ts' ) ;
4040
4141 expect ( moduleContent ) . toContain ( 'DragDropModule' ) ;
4242 } ) ;
4343
4444 describe ( 'style option' , ( ) => {
45- it ( 'should respect the option value' , ( ) => {
45+ it ( 'should respect the option value' , async ( ) => {
4646 const tree = runner . runSchematic (
47- 'drag-drop' , { style : 'scss' , ...baseOptions } , createTestApp ( runner ) ) ;
47+ 'drag-drop' , { style : 'scss' , ...baseOptions } , await createTestApp ( runner ) ) ;
4848
4949 expect ( tree . files ) . toContain ( '/projects/material/src/app/foo/foo.component.scss' ) ;
5050 } ) ;
5151
52- it ( 'should respect the deprecated "styleext" option value' , ( ) => {
53- let tree = createTestApp ( runner ) ;
52+ it ( 'should respect the deprecated "styleext" option value' , async ( ) => {
53+ let tree = await createTestApp ( runner ) ;
5454 const workspace = getWorkspace ( tree ) ;
5555 const project = getProjectFromWorkspace ( workspace ) ;
5656
@@ -66,9 +66,9 @@ describe('CDK drag-drop schematic', () => {
6666 expect ( tree . files ) . toContain ( '/projects/material/src/app/foo/foo.component.scss' ) ;
6767 } ) ;
6868
69- it ( 'should not generate invalid stylesheets' , ( ) => {
69+ it ( 'should not generate invalid stylesheets' , async ( ) => {
7070 const tree = runner . runSchematic (
71- 'drag-drop' , { style : 'styl' , ...baseOptions } , createTestApp ( runner ) ) ;
71+ 'drag-drop' , { style : 'styl' , ...baseOptions } , await createTestApp ( runner ) ) ;
7272
7373 // In this case we expect the schematic to generate a plain "css" file because
7474 // the component schematics are using CSS style templates which are not compatible
@@ -79,56 +79,56 @@ describe('CDK drag-drop schematic', () => {
7979 'Expected the schematic to not generate a "stylus" file' ) ;
8080 } ) ;
8181
82- it ( 'should fall back to the @schematics/angular:component option value' , ( ) => {
82+ it ( 'should fall back to the @schematics/angular:component option value' , async ( ) => {
8383 const tree = runner . runSchematic (
84- 'drag-drop' , baseOptions , createTestApp ( runner , { style : 'less' } ) ) ;
84+ 'drag-drop' , baseOptions , await createTestApp ( runner , { style : 'less' } ) ) ;
8585
8686 expect ( tree . files ) . toContain ( '/projects/material/src/app/foo/foo.component.less' ) ;
8787 } ) ;
8888 } ) ;
8989
9090 describe ( 'inlineStyle option' , ( ) => {
91- it ( 'should respect the option value' , ( ) => {
91+ it ( 'should respect the option value' , async ( ) => {
9292 const tree = runner . runSchematic (
93- 'drag-drop' , { inlineStyle : true , ...baseOptions } , createTestApp ( runner ) ) ;
93+ 'drag-drop' , { inlineStyle : true , ...baseOptions } , await createTestApp ( runner ) ) ;
9494
9595 expect ( tree . files ) . not . toContain ( '/projects/material/src/app/foo/foo.component.css' ) ;
9696 } ) ;
9797
98- it ( 'should fall back to the @schematics/angular:component option value' , ( ) => {
98+ it ( 'should fall back to the @schematics/angular:component option value' , async ( ) => {
9999 const tree = runner . runSchematic (
100- 'drag-drop' , baseOptions , createTestApp ( runner , { inlineStyle : true } ) ) ;
100+ 'drag-drop' , baseOptions , await createTestApp ( runner , { inlineStyle : true } ) ) ;
101101
102102 expect ( tree . files ) . not . toContain ( '/projects/material/src/app/foo/foo.component.css' ) ;
103103 } ) ;
104104 } ) ;
105105
106106 describe ( 'inlineTemplate option' , ( ) => {
107- it ( 'should respect the option value' , ( ) => {
107+ it ( 'should respect the option value' , async ( ) => {
108108 const tree = runner . runSchematic (
109- 'drag-drop' , { inlineTemplate : true , ...baseOptions } , createTestApp ( runner ) ) ;
109+ 'drag-drop' , { inlineTemplate : true , ...baseOptions } , await createTestApp ( runner ) ) ;
110110
111111 expect ( tree . files ) . not . toContain ( '/projects/material/src/app/foo/foo.component.html' ) ;
112112 } ) ;
113113
114- it ( 'should fall back to the @schematics/angular:component option value' , ( ) => {
114+ it ( 'should fall back to the @schematics/angular:component option value' , async ( ) => {
115115 const tree = runner . runSchematic (
116- 'drag-drop' , baseOptions , createTestApp ( runner , { inlineTemplate : true } ) ) ;
116+ 'drag-drop' , baseOptions , await createTestApp ( runner , { inlineTemplate : true } ) ) ;
117117
118118 expect ( tree . files ) . not . toContain ( '/projects/material/src/app/foo/foo.component.html' ) ;
119119 } ) ;
120120 } ) ;
121121
122122 describe ( 'skipTests option' , ( ) => {
123- it ( 'should respect the option value' , ( ) => {
123+ it ( 'should respect the option value' , async ( ) => {
124124 const tree = runner . runSchematic (
125- 'drag-drop' , { skipTests : true , ...baseOptions } , createTestApp ( runner ) ) ;
125+ 'drag-drop' , { skipTests : true , ...baseOptions } , await createTestApp ( runner ) ) ;
126126
127127 expect ( tree . files ) . not . toContain ( '/projects/material/src/app/foo/foo.component.spec.ts' ) ;
128128 } ) ;
129129
130- it ( 'should respect the deprecated global "spec" option value' , ( ) => {
131- let tree = createTestApp ( runner ) ;
130+ it ( 'should respect the deprecated global "spec" option value' , async ( ) => {
131+ let tree = await createTestApp ( runner ) ;
132132 const workspace = getWorkspace ( tree ) ;
133133 const project = getProjectFromWorkspace ( workspace ) ;
134134
@@ -144,9 +144,9 @@ describe('CDK drag-drop schematic', () => {
144144 expect ( tree . files ) . not . toContain ( '/projects/material/src/app/foo/foo.component.spec.ts' ) ;
145145 } ) ;
146146
147- it ( 'should fall back to the @schematics/angular:component option value' , ( ) => {
147+ it ( 'should fall back to the @schematics/angular:component option value' , async ( ) => {
148148 const tree = runner . runSchematic (
149- 'drag-drop' , baseOptions , createTestApp ( runner , { skipTests : true } ) ) ;
149+ 'drag-drop' , baseOptions , await createTestApp ( runner , { skipTests : true } ) ) ;
150150
151151 expect ( tree . files ) . not . toContain ( '/projects/material/src/app/foo/foo.component.spec.ts' ) ;
152152 } ) ;
0 commit comments