@@ -10,6 +10,7 @@ import { Schema as ApplicationOptions, Style } from '../application/schema';
1010import { Schema as WorkspaceOptions } from '../workspace/schema' ;
1111import { Schema as UniversalOptions } from './schema' ;
1212
13+ // tslint:disable-next-line:no-big-function
1314describe ( 'Universal Schematic' , ( ) => {
1415 const schematicRunner = new SchematicTestRunner (
1516 '@schematics/angular' ,
@@ -82,7 +83,6 @@ describe('Universal Schematic', () => {
8283 const tree = await schematicRunner
8384 . runSchematicAsync ( 'universal' , workspaceUniversalOptions , appTree )
8485 . toPromise ( ) ;
85- debugger ;
8686 const filePath = '/tsconfig.server.json' ;
8787 expect ( tree . exists ( filePath ) ) . toEqual ( true ) ;
8888 const contents = tree . readContent ( filePath ) ;
@@ -204,4 +204,17 @@ describe('Universal Schematic', () => {
204204 expect ( schematicRunner . tasks [ 0 ] . name ) . toBe ( 'node-package' ) ;
205205 expect ( ( schematicRunner . tasks [ 0 ] . options as { command : string } ) . command ) . toBe ( 'install' ) ;
206206 } ) ;
207+
208+ it ( `should work when 'tsconfig.app.json' has comments` , async ( ) => {
209+ const appTsConfigPath = '/projects/bar/tsconfig.app.json' ;
210+ const appTsConfigContent = appTree . readContent ( appTsConfigPath ) ;
211+ appTree . overwrite ( appTsConfigPath , '// comment in json file\n' + appTsConfigContent ) ;
212+
213+ const tree = await schematicRunner . runSchematicAsync ( 'universal' , defaultOptions , appTree )
214+ . toPromise ( ) ;
215+
216+ const filePath = '/projects/bar/tsconfig.server.json' ;
217+ expect ( tree . exists ( filePath ) ) . toEqual ( true ) ;
218+ } ) ;
219+
207220} ) ;
0 commit comments