@@ -24,8 +24,8 @@ describe('Component Schematic', () => {
2424 inlineStyle : false ,
2525 inlineTemplate : false ,
2626 changeDetection : ChangeDetection . Default ,
27- styleext : 'css' ,
28- spec : true ,
27+ style : 'css' ,
28+ skipTests : false ,
2929 module : undefined ,
3030 export : false ,
3131 project : 'bar' ,
@@ -249,8 +249,8 @@ describe('Component Schematic', () => {
249249 expect ( tree . files ) . not . toContain ( '/projects/bar/src/app/foo/foo.component.css' ) ;
250250 } ) ;
251251
252- it ( 'should respect the styleext option' , ( ) => {
253- const options = { ...defaultOptions , styleext : 'scss' } ;
252+ it ( 'should respect the style option' , ( ) => {
253+ const options = { ...defaultOptions , style : 'scss' } ;
254254 const tree = schematicRunner . runSchematic ( 'component' , options , appTree ) ;
255255 const content = tree . readContent ( '/projects/bar/src/app/foo/foo.component.ts' ) ;
256256 expect ( content ) . toMatch ( / s t y l e U r l s : \[ ' .\/ f o o .c o m p o n e n t .s c s s / ) ;
@@ -310,4 +310,34 @@ describe('Component Schematic', () => {
310310 appTree = schematicRunner . runSchematic ( 'component' , defaultOptions , appTree ) ;
311311 expect ( appTree . files ) . toContain ( '/projects/bar/custom/app/foo/foo.component.ts' ) ;
312312 } ) ;
313+
314+ // testing deprecating options don't cause conflicts
315+ it ( 'should respect the deprecated styleext (scss) option' , ( ) => {
316+ const options = { ...defaultOptions , style : undefined , styleext : 'scss' } ;
317+ const tree = schematicRunner . runSchematic ( 'component' , options , appTree ) ;
318+ const files = tree . files ;
319+ expect ( files ) . toContain ( '/projects/bar/src/app/foo/foo.component.scss' ) ;
320+ } ) ;
321+
322+ it ( 'should respect the deprecated styleext (css) option' , ( ) => {
323+ const options = { ...defaultOptions , style : undefined , styleext : 'css' } ;
324+ const tree = schematicRunner . runSchematic ( 'component' , options , appTree ) ;
325+ const files = tree . files ;
326+ expect ( files ) . toContain ( '/projects/bar/src/app/foo/foo.component.css' ) ;
327+ } ) ;
328+
329+ it ( 'should respect the deprecated spec option when false' , ( ) => {
330+ const options = { ...defaultOptions , skipTests : undefined , spec : false } ;
331+ const tree = schematicRunner . runSchematic ( 'component' , options , appTree ) ;
332+ const files = tree . files ;
333+ expect ( files ) . not . toContain ( '/projects/bar/src/app/foo/foo.component.spec.ts' ) ;
334+ } ) ;
335+
336+ it ( 'should respect the deprecated spec option when true' , ( ) => {
337+ const options = { ...defaultOptions , skipTests : false , spec : true } ;
338+ const tree = schematicRunner . runSchematic ( 'component' , options , appTree ) ;
339+ const files = tree . files ;
340+ expect ( files ) . toContain ( '/projects/bar/src/app/foo/foo.component.spec.ts' ) ;
341+ } ) ;
342+
313343} ) ;
0 commit comments