@@ -10,7 +10,7 @@ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/te
10
10
import { latestVersions } from '../utility/latest-versions' ;
11
11
import { getFileContent } from '../utility/test' ;
12
12
import { Schema as WorkspaceOptions } from '../workspace/schema' ;
13
- import { Schema as ApplicationOptions } from './schema' ;
13
+ import { Schema as ApplicationOptions , Style } from './schema' ;
14
14
15
15
// tslint:disable:max-line-length
16
16
describe ( 'Application Schematic' , ( ) => {
@@ -275,6 +275,22 @@ describe('Application Schematic', () => {
275
275
] ) ;
276
276
} ) ;
277
277
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
+
278
294
it ( 'should set the relative tsconfig paths' , ( ) => {
279
295
const options = { ...defaultOptions , projectRoot : '' } ;
280
296
0 commit comments