@@ -188,4 +188,55 @@ describe('Universal Schematic', () => {
188
188
} ;
189
189
expect ( compilerOptions . types ) . toContain ( '@angular/localize' ) ;
190
190
} ) ;
191
+
192
+ describe ( 'standalone application' , ( ) => {
193
+ let standaloneAppOptions ;
194
+ let defaultStandaloneOptions : UniversalOptions ;
195
+ beforeEach ( async ( ) => {
196
+ const standaloneAppName = 'baz' ;
197
+ standaloneAppOptions = {
198
+ ...appOptions ,
199
+ name : standaloneAppName ,
200
+ standalone : true ,
201
+ } ;
202
+ defaultStandaloneOptions = {
203
+ project : standaloneAppName ,
204
+ } ;
205
+ appTree = await schematicRunner . runSchematic ( 'application' , standaloneAppOptions , appTree ) ;
206
+ } ) ;
207
+
208
+ it ( 'should create not root module file' , async ( ) => {
209
+ const tree = await schematicRunner . runSchematic (
210
+ 'universal' ,
211
+ defaultStandaloneOptions ,
212
+ appTree ,
213
+ ) ;
214
+ const filePath = '/projects/baz/src/app/app.server.module.ts' ;
215
+ expect ( tree . exists ( filePath ) ) . toEqual ( false ) ;
216
+ } ) ;
217
+
218
+ it ( 'should create a main file' , async ( ) => {
219
+ const tree = await schematicRunner . runSchematic (
220
+ 'universal' ,
221
+ defaultStandaloneOptions ,
222
+ appTree ,
223
+ ) ;
224
+ const filePath = '/projects/baz/src/main.server.ts' ;
225
+ expect ( tree . exists ( filePath ) ) . toEqual ( true ) ;
226
+ const contents = tree . readContent ( filePath ) ;
227
+ expect ( contents ) . toContain ( `bootstrapApplication(AppComponent, config)` ) ;
228
+ } ) ;
229
+
230
+ it ( 'should create server app config file' , async ( ) => {
231
+ const tree = await schematicRunner . runSchematic (
232
+ 'universal' ,
233
+ defaultStandaloneOptions ,
234
+ appTree ,
235
+ ) ;
236
+ const filePath = '/projects/baz/src/app/app.config.server.ts' ;
237
+ expect ( tree . exists ( filePath ) ) . toEqual ( true ) ;
238
+ const contents = tree . readContent ( filePath ) ;
239
+ expect ( contents ) . toContain ( `const serverConfig: ApplicationConfig = {` ) ;
240
+ } ) ;
241
+ } ) ;
191
242
} ) ;
0 commit comments