@@ -20,8 +20,8 @@ describe('CDK drag-drop schematic', () => {
20
20
runner = new SchematicTestRunner ( 'schematics' , require . resolve ( '../../collection.json' ) ) ;
21
21
} ) ;
22
22
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 ) ) ;
25
25
const moduleContent = getFileContent ( tree , '/projects/material/src/app/app.module.ts' ) ;
26
26
const files = tree . files ;
27
27
@@ -34,23 +34,23 @@ describe('CDK drag-drop schematic', () => {
34
34
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) ;
35
35
} ) ;
36
36
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 ) ) ;
39
39
const moduleContent = getFileContent ( tree , '/projects/material/src/app/app.module.ts' ) ;
40
40
41
41
expect ( moduleContent ) . toContain ( 'DragDropModule' ) ;
42
42
} ) ;
43
43
44
44
describe ( 'style option' , ( ) => {
45
- it ( 'should respect the option value' , ( ) => {
45
+ it ( 'should respect the option value' , async ( ) => {
46
46
const tree = runner . runSchematic (
47
- 'drag-drop' , { style : 'scss' , ...baseOptions } , createTestApp ( runner ) ) ;
47
+ 'drag-drop' , { style : 'scss' , ...baseOptions } , await createTestApp ( runner ) ) ;
48
48
49
49
expect ( tree . files ) . toContain ( '/projects/material/src/app/foo/foo.component.scss' ) ;
50
50
} ) ;
51
51
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 ) ;
54
54
const workspace = getWorkspace ( tree ) ;
55
55
const project = getProjectFromWorkspace ( workspace ) ;
56
56
@@ -66,9 +66,9 @@ describe('CDK drag-drop schematic', () => {
66
66
expect ( tree . files ) . toContain ( '/projects/material/src/app/foo/foo.component.scss' ) ;
67
67
} ) ;
68
68
69
- it ( 'should not generate invalid stylesheets' , ( ) => {
69
+ it ( 'should not generate invalid stylesheets' , async ( ) => {
70
70
const tree = runner . runSchematic (
71
- 'drag-drop' , { style : 'styl' , ...baseOptions } , createTestApp ( runner ) ) ;
71
+ 'drag-drop' , { style : 'styl' , ...baseOptions } , await createTestApp ( runner ) ) ;
72
72
73
73
// In this case we expect the schematic to generate a plain "css" file because
74
74
// the component schematics are using CSS style templates which are not compatible
@@ -79,56 +79,56 @@ describe('CDK drag-drop schematic', () => {
79
79
'Expected the schematic to not generate a "stylus" file' ) ;
80
80
} ) ;
81
81
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 ( ) => {
83
83
const tree = runner . runSchematic (
84
- 'drag-drop' , baseOptions , createTestApp ( runner , { style : 'less' } ) ) ;
84
+ 'drag-drop' , baseOptions , await createTestApp ( runner , { style : 'less' } ) ) ;
85
85
86
86
expect ( tree . files ) . toContain ( '/projects/material/src/app/foo/foo.component.less' ) ;
87
87
} ) ;
88
88
} ) ;
89
89
90
90
describe ( 'inlineStyle option' , ( ) => {
91
- it ( 'should respect the option value' , ( ) => {
91
+ it ( 'should respect the option value' , async ( ) => {
92
92
const tree = runner . runSchematic (
93
- 'drag-drop' , { inlineStyle : true , ...baseOptions } , createTestApp ( runner ) ) ;
93
+ 'drag-drop' , { inlineStyle : true , ...baseOptions } , await createTestApp ( runner ) ) ;
94
94
95
95
expect ( tree . files ) . not . toContain ( '/projects/material/src/app/foo/foo.component.css' ) ;
96
96
} ) ;
97
97
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 ( ) => {
99
99
const tree = runner . runSchematic (
100
- 'drag-drop' , baseOptions , createTestApp ( runner , { inlineStyle : true } ) ) ;
100
+ 'drag-drop' , baseOptions , await createTestApp ( runner , { inlineStyle : true } ) ) ;
101
101
102
102
expect ( tree . files ) . not . toContain ( '/projects/material/src/app/foo/foo.component.css' ) ;
103
103
} ) ;
104
104
} ) ;
105
105
106
106
describe ( 'inlineTemplate option' , ( ) => {
107
- it ( 'should respect the option value' , ( ) => {
107
+ it ( 'should respect the option value' , async ( ) => {
108
108
const tree = runner . runSchematic (
109
- 'drag-drop' , { inlineTemplate : true , ...baseOptions } , createTestApp ( runner ) ) ;
109
+ 'drag-drop' , { inlineTemplate : true , ...baseOptions } , await createTestApp ( runner ) ) ;
110
110
111
111
expect ( tree . files ) . not . toContain ( '/projects/material/src/app/foo/foo.component.html' ) ;
112
112
} ) ;
113
113
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 ( ) => {
115
115
const tree = runner . runSchematic (
116
- 'drag-drop' , baseOptions , createTestApp ( runner , { inlineTemplate : true } ) ) ;
116
+ 'drag-drop' , baseOptions , await createTestApp ( runner , { inlineTemplate : true } ) ) ;
117
117
118
118
expect ( tree . files ) . not . toContain ( '/projects/material/src/app/foo/foo.component.html' ) ;
119
119
} ) ;
120
120
} ) ;
121
121
122
122
describe ( 'skipTests option' , ( ) => {
123
- it ( 'should respect the option value' , ( ) => {
123
+ it ( 'should respect the option value' , async ( ) => {
124
124
const tree = runner . runSchematic (
125
- 'drag-drop' , { skipTests : true , ...baseOptions } , createTestApp ( runner ) ) ;
125
+ 'drag-drop' , { skipTests : true , ...baseOptions } , await createTestApp ( runner ) ) ;
126
126
127
127
expect ( tree . files ) . not . toContain ( '/projects/material/src/app/foo/foo.component.spec.ts' ) ;
128
128
} ) ;
129
129
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 ) ;
132
132
const workspace = getWorkspace ( tree ) ;
133
133
const project = getProjectFromWorkspace ( workspace ) ;
134
134
@@ -144,9 +144,9 @@ describe('CDK drag-drop schematic', () => {
144
144
expect ( tree . files ) . not . toContain ( '/projects/material/src/app/foo/foo.component.spec.ts' ) ;
145
145
} ) ;
146
146
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 ( ) => {
148
148
const tree = runner . runSchematic (
149
- 'drag-drop' , baseOptions , createTestApp ( runner , { skipTests : true } ) ) ;
149
+ 'drag-drop' , baseOptions , await createTestApp ( runner , { skipTests : true } ) ) ;
150
150
151
151
expect ( tree . files ) . not . toContain ( '/projects/material/src/app/foo/foo.component.spec.ts' ) ;
152
152
} ) ;
0 commit comments