@@ -399,6 +399,66 @@ describe('Application Schematic', () => {
399
399
expect ( tree . exists ( 'src/styles.sass' ) ) . toBe ( true ) ;
400
400
} ) ;
401
401
402
+ it ( 'sets "inlineStyleLanguage" in angular.json when using a style preprocessor' , async ( ) => {
403
+ const options = { ...defaultOptions , projectRoot : '' , style : Style . Sass } ;
404
+ const tree = await schematicRunner
405
+ . runSchematicAsync ( 'application' , options , workspaceTree )
406
+ . toPromise ( ) ;
407
+ const config = JSON . parse ( tree . readContent ( '/angular.json' ) ) ;
408
+ const prj = config . projects . foo ;
409
+
410
+ const buildOpt = prj . architect . build . options ;
411
+ expect ( buildOpt . inlineStyleLanguage ) . toBe ( 'sass' ) ;
412
+
413
+ const testOpt = prj . architect . test . options ;
414
+ expect ( testOpt . inlineStyleLanguage ) . toBe ( 'sass' ) ;
415
+ } ) ;
416
+
417
+ it ( 'does not set "inlineStyleLanguage" in angular.json when not using a style preprocessor' , async ( ) => {
418
+ const options = { ...defaultOptions , projectRoot : '' } ;
419
+ const tree = await schematicRunner
420
+ . runSchematicAsync ( 'application' , options , workspaceTree )
421
+ . toPromise ( ) ;
422
+ const config = JSON . parse ( tree . readContent ( '/angular.json' ) ) ;
423
+ const prj = config . projects . foo ;
424
+
425
+ const buildOpt = prj . architect . build . options ;
426
+ expect ( buildOpt . inlineStyleLanguage ) . toBeUndefined ( ) ;
427
+
428
+ const testOpt = prj . architect . test . options ;
429
+ expect ( testOpt . inlineStyleLanguage ) . toBeUndefined ( ) ;
430
+ } ) ;
431
+
432
+ it ( 'does not set "inlineStyleLanguage" in angular.json when using CSS styles' , async ( ) => {
433
+ const options = { ...defaultOptions , projectRoot : '' , style : Style . Css } ;
434
+ const tree = await schematicRunner
435
+ . runSchematicAsync ( 'application' , options , workspaceTree )
436
+ . toPromise ( ) ;
437
+ const config = JSON . parse ( tree . readContent ( '/angular.json' ) ) ;
438
+ const prj = config . projects . foo ;
439
+
440
+ const buildOpt = prj . architect . build . options ;
441
+ expect ( buildOpt . inlineStyleLanguage ) . toBeUndefined ( ) ;
442
+
443
+ const testOpt = prj . architect . test . options ;
444
+ expect ( testOpt . inlineStyleLanguage ) . toBeUndefined ( ) ;
445
+ } ) ;
446
+
447
+ it ( 'does not set "inlineStyleLanguage" in angular.json when using Stylus styles' , async ( ) => {
448
+ const options = { ...defaultOptions , projectRoot : '' , style : Style . Styl } ;
449
+ const tree = await schematicRunner
450
+ . runSchematicAsync ( 'application' , options , workspaceTree )
451
+ . toPromise ( ) ;
452
+ const config = JSON . parse ( tree . readContent ( '/angular.json' ) ) ;
453
+ const prj = config . projects . foo ;
454
+
455
+ const buildOpt = prj . architect . build . options ;
456
+ expect ( buildOpt . inlineStyleLanguage ) . toBeUndefined ( ) ;
457
+
458
+ const testOpt = prj . architect . test . options ;
459
+ expect ( testOpt . inlineStyleLanguage ) . toBeUndefined ( ) ;
460
+ } ) ;
461
+
402
462
it ( 'should set the relative tsconfig paths' , async ( ) => {
403
463
const options = { ...defaultOptions , projectRoot : '' } ;
404
464
const tree = await schematicRunner . runSchematicAsync ( 'application' , options , workspaceTree )
0 commit comments