File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
packages/angular/src/schematics/init Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -214,5 +214,16 @@ describe('init', () => {
214214 const workspaceJson = readJsonInTree ( result , 'workspace.json' ) ;
215215 expect ( workspaceJson . cli . defaultCollection ) . toEqual ( '@nrwl/angular' ) ;
216216 } ) ;
217+
218+ it . each ( [ 'css' , 'scss' , 'styl' , 'less' ] ) (
219+ 'should set "%s" as default style extension for components' ,
220+ async ( style ) => {
221+ const result = await runSchematic ( 'init' , { style } , appTree ) ;
222+ const workspaceJson = readJsonInTree ( result , 'workspace.json' ) ;
223+ expect (
224+ workspaceJson . schematics [ '@nrwl/angular:component' ] [ 'style' ]
225+ ) . toBe ( style ) ;
226+ }
227+ ) ;
217228 } ) ;
218229} ) ;
Original file line number Diff line number Diff line change @@ -139,6 +139,11 @@ export function setDefaults(options: Schema): Rule {
139139 workspace . extensions . schematics [ '@nrwl/angular:library' ] . unitTestRunner =
140140 workspace . extensions . schematics [ '@nrwl/angular:library' ] . unitTestRunner ||
141141 options . unitTestRunner ;
142+
143+ workspace . extensions . schematics [ '@nrwl/angular:component' ] = workspace
144+ . extensions . schematics [ '@nrwl/angular:component' ] || {
145+ style : options . style ,
146+ } ;
142147 } ) ;
143148
144149 return chain ( [ setDefaultCollection ( '@nrwl/angular' ) , updateAngularWorkspace ] ) ;
Original file line number Diff line number Diff line change 1- import { UnitTestRunner } from '../../utils/test-runners' ;
1+ import { E2eTestRunner , UnitTestRunner } from '../../utils/test-runners' ;
22export interface Schema {
33 unitTestRunner : UnitTestRunner ;
44 e2eTestRunner ?: E2eTestRunner ;
55 skipFormat : boolean ;
66 skipInstall ?: boolean ;
7+ style ?: string ;
78}
You can’t perform that action at this time.
0 commit comments