File tree Expand file tree Collapse file tree 4 files changed +43
-0
lines changed
packages/schematics/angular Expand file tree Collapse file tree 4 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -99,4 +99,14 @@ describe('Class Schematic', () => {
99
99
appTree = await schematicRunner . runSchematicAsync ( 'class' , defaultOptions , appTree ) . toPromise ( ) ;
100
100
expect ( appTree . files ) . toContain ( '/projects/bar/custom/app/foo.ts' ) ;
101
101
} ) ;
102
+
103
+ it ( 'should respect the skipTests flag' , async ( ) => {
104
+ const options = {
105
+ ...defaultOptions ,
106
+ skipTests : true ,
107
+ } ;
108
+ const tree = await schematicRunner . runSchematicAsync ( 'class' , options , appTree ) . toPromise ( ) ;
109
+ expect ( tree . files ) . toContain ( '/projects/bar/src/app/foo.ts' ) ;
110
+ expect ( tree . files ) . not . toContain ( '/projects/bar/src/app/foo.spec.ts' ) ;
111
+ } ) ;
102
112
} ) ;
Original file line number Diff line number Diff line change @@ -365,4 +365,19 @@ describe('Component Schematic', () => {
365
365
. toPromise ( ) ;
366
366
expect ( appTree . files ) . toContain ( '/projects/bar/custom/app/foo/foo.component.ts' ) ;
367
367
} ) ;
368
+
369
+ it ( 'should respect the skipTests option' , async ( ) => {
370
+ const options = { ...defaultOptions , skipTests : true } ;
371
+ const tree = await schematicRunner . runSchematicAsync ( 'component' , options , appTree ) . toPromise ( ) ;
372
+ const files = tree . files ;
373
+
374
+ expect ( files ) . toEqual (
375
+ jasmine . arrayContaining ( [
376
+ '/projects/bar/src/app/foo/foo.component.css' ,
377
+ '/projects/bar/src/app/foo/foo.component.html' ,
378
+ '/projects/bar/src/app/foo/foo.component.ts' ,
379
+ ] ) ,
380
+ ) ;
381
+ expect ( tree . files ) . not . toContain ( '/projects/bar/src/app/foo/foo.component.spec.ts' ) ;
382
+ } ) ;
368
383
} ) ;
Original file line number Diff line number Diff line change @@ -174,4 +174,13 @@ describe('Directive Schematic', () => {
174
174
. toPromise ( ) ;
175
175
expect ( appTree . files ) . toContain ( '/projects/bar/custom/app/foo.directive.ts' ) ;
176
176
} ) ;
177
+
178
+ it ( 'should respect skipTests flag' , async ( ) => {
179
+ const options = { ...defaultOptions , skipTests : true } ;
180
+
181
+ const tree = await schematicRunner . runSchematicAsync ( 'directive' , options , appTree ) . toPromise ( ) ;
182
+ const files = tree . files ;
183
+ expect ( files ) . toContain ( '/projects/bar/src/app/foo.directive.ts' ) ;
184
+ expect ( files ) . not . toContain ( '/projects/bar/src/app/foo.directive.spec.ts' ) ;
185
+ } ) ;
177
186
} ) ;
Original file line number Diff line number Diff line change @@ -138,4 +138,13 @@ describe('Pipe Schematic', () => {
138
138
appTree = await schematicRunner . runSchematicAsync ( 'pipe' , defaultOptions , appTree ) . toPromise ( ) ;
139
139
expect ( appTree . files ) . toContain ( '/projects/bar/custom/app/foo.pipe.ts' ) ;
140
140
} ) ;
141
+
142
+ it ( 'should respect the skipTests flag' , async ( ) => {
143
+ const options = { ...defaultOptions , skipTests : true } ;
144
+
145
+ const tree = await schematicRunner . runSchematicAsync ( 'pipe' , options , appTree ) . toPromise ( ) ;
146
+ const files = tree . files ;
147
+ expect ( files ) . not . toContain ( '/projects/bar/src/app/foo.pipe.spec.ts' ) ;
148
+ expect ( files ) . toContain ( '/projects/bar/src/app/foo.pipe.ts' ) ;
149
+ } ) ;
141
150
} ) ;
You can’t perform that action at this time.
0 commit comments