@@ -10,6 +10,7 @@ import { Schema as ApplicationOptions, Style } from '../application/schema';
10
10
import { Schema as WorkspaceOptions } from '../workspace/schema' ;
11
11
import { Schema as UniversalOptions } from './schema' ;
12
12
13
+ // tslint:disable-next-line:no-big-function
13
14
describe ( 'Universal Schematic' , ( ) => {
14
15
const schematicRunner = new SchematicTestRunner (
15
16
'@schematics/angular' ,
@@ -82,7 +83,6 @@ describe('Universal Schematic', () => {
82
83
const tree = await schematicRunner
83
84
. runSchematicAsync ( 'universal' , workspaceUniversalOptions , appTree )
84
85
. toPromise ( ) ;
85
- debugger ;
86
86
const filePath = '/tsconfig.server.json' ;
87
87
expect ( tree . exists ( filePath ) ) . toEqual ( true ) ;
88
88
const contents = tree . readContent ( filePath ) ;
@@ -204,4 +204,17 @@ describe('Universal Schematic', () => {
204
204
expect ( schematicRunner . tasks [ 0 ] . name ) . toBe ( 'node-package' ) ;
205
205
expect ( ( schematicRunner . tasks [ 0 ] . options as { command : string } ) . command ) . toBe ( 'install' ) ;
206
206
} ) ;
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
+
207
220
} ) ;
0 commit comments