File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed
modules/schematics/src/container Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -154,4 +154,28 @@ describe('Container Schematic', () => {
154
154
/ i m p o r t { S t o r e , S t o r e M o d u l e } f r o m ' @ n g r x \/ s t o r e ' ; /
155
155
) ;
156
156
} ) ;
157
+
158
+ describe ( 'standalone' , ( ) => {
159
+ it ( 'should be disabled by default' , async ( ) => {
160
+ const options = { ...defaultOptions , standalone : false } ;
161
+ const tree = await schematicRunner
162
+ . runSchematicAsync ( 'container' , options , appTree )
163
+ . toPromise ( ) ;
164
+ const content = tree . readContent (
165
+ `${ projectPath } /src/app/foo/foo.component.ts`
166
+ ) ;
167
+ expect ( content ) . not . toMatch ( / s t a n d a l o n e : t r u e / ) ;
168
+ } ) ;
169
+
170
+ it ( 'should create a standalone component if true' , async ( ) => {
171
+ const options = { ...defaultOptions , standalone : true } ;
172
+ const tree = await schematicRunner
173
+ . runSchematicAsync ( 'container' , options , appTree )
174
+ . toPromise ( ) ;
175
+ const content = tree . readContent (
176
+ `${ projectPath } /src/app/foo/foo.component.ts`
177
+ ) ;
178
+ expect ( content ) . toMatch ( / s t a n d a l o n e : t r u e / ) ;
179
+ } ) ;
180
+ } ) ;
157
181
} ) ;
Original file line number Diff line number Diff line change 99
99
"enum" : [" unit" , " integration" ],
100
100
"type" : " string" ,
101
101
"default" : " integration"
102
+ },
103
+ "standalone" : {
104
+ "description" : " Whether the generated component is standalone." ,
105
+ "type" : " boolean"
102
106
}
103
107
},
104
108
"required" : []
Original file line number Diff line number Diff line change @@ -73,4 +73,9 @@ export interface Schema {
73
73
* Specifies whether to create a unit test or an integration test.
74
74
*/
75
75
testDepth ?: string ;
76
+
77
+ /**
78
+ * Whether the generated component is standalone
79
+ */
80
+ standalone ?: boolean ;
76
81
}
You can’t perform that action at this time.
0 commit comments