@@ -10,7 +10,7 @@ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/te
1010import { latestVersions } from '../utility/latest-versions' ;
1111import { getFileContent } from '../utility/test' ;
1212import { Schema as WorkspaceOptions } from '../workspace/schema' ;
13- import { Schema as ApplicationOptions } from './schema' ;
13+ import { Schema as ApplicationOptions , Style } from './schema' ;
1414
1515// tslint:disable:max-line-length
1616describe ( 'Application Schematic' , ( ) => {
@@ -275,6 +275,22 @@ describe('Application Schematic', () => {
275275 ] ) ;
276276 } ) ;
277277
278+ it ( 'should set values in angular.json correctly when using a style preprocessor' , ( ) => {
279+ const options = { ...defaultOptions , projectRoot : '' , style : Style . Sass } ;
280+ const tree = schematicRunner . runSchematic ( 'application' , options , workspaceTree ) ;
281+ const config = JSON . parse ( tree . readContent ( '/angular.json' ) ) ;
282+ const prj = config . projects . foo ;
283+ const buildOpt = prj . architect . build . options ;
284+ expect ( buildOpt . styles ) . toEqual ( [
285+ 'src/styles.scss' ,
286+ ] ) ;
287+ const testOpt = prj . architect . test . options ;
288+ expect ( testOpt . styles ) . toEqual ( [
289+ 'src/styles.scss' ,
290+ ] ) ;
291+ expect ( tree . exists ( 'src/styles.scss' ) ) . toBe ( true ) ;
292+ } ) ;
293+
278294 it ( 'should set the relative tsconfig paths' , ( ) => {
279295 const options = { ...defaultOptions , projectRoot : '' } ;
280296
0 commit comments