@@ -5,6 +5,7 @@ import path from 'path';
55import helpers from 'ember-cli-blueprint-test-helpers/helpers' ;
66import chaiHelpers from 'ember-cli-blueprint-test-helpers/chai' ;
77import Blueprint from 'ember-cli/lib/models/blueprint' ;
8+ import ts from 'typescript' ;
89
910import { setupPublishedVersionStashing } from '../helpers/stash-published-version' ;
1011import ects from '../../blueprints/ember-cli-typescript/index' ;
@@ -71,7 +72,7 @@ describe('Acceptance: ember-cli-typescript generator', function () {
7172 const tsconfig = file ( 'tsconfig.json' ) ;
7273 expect ( tsconfig ) . to . exist ;
7374
74- const tsconfigJson = JSON . parse ( tsconfig . content ) ;
75+ const tsconfigJson = ts . parseConfigFileTextToJson ( ' tsconfig.json' , tsconfig . content ) . config ;
7576 expect ( tsconfigJson . compilerOptions . paths ) . to . deep . equal ( {
7677 'my-app/tests/*' : [ 'tests/*' ] ,
7778 'my-app/*' : [ 'app/*' ] ,
@@ -121,7 +122,7 @@ describe('Acceptance: ember-cli-typescript generator', function () {
121122 const tsconfig = file ( 'tsconfig.json' ) ;
122123 expect ( tsconfig ) . to . exist ;
123124
124- const tsconfigJson = JSON . parse ( tsconfig . content ) ;
125+ const tsconfigJson = ts . parseConfigFileTextToJson ( ' tsconfig.json' , tsconfig . content ) . config ;
125126 expect ( tsconfigJson . compilerOptions . paths ) . to . deep . equal ( {
126127 'dummy/tests/*' : [ 'tests/*' ] ,
127128 'dummy/*' : [ 'tests/dummy/app/*' , 'app/*' ] ,
@@ -197,7 +198,7 @@ describe('Acceptance: ember-cli-typescript generator', function () {
197198 const tsconfig = file ( 'tsconfig.json' ) ;
198199 expect ( tsconfig ) . to . exist ;
199200
200- const json = JSON . parse ( tsconfig . content ) ;
201+ const json = ts . parseConfigFileTextToJson ( ' tsconfig.json' , tsconfig . content ) . config ;
201202 expect ( json . compilerOptions . paths ) . to . deep . equal ( {
202203 'my-app/tests/*' : [ 'tests/*' ] ,
203204 'my-app/*' : [ 'app/*' , 'lib/my-addon-1/app/*' , 'lib/my-addon-2/app/*' ] ,
@@ -243,7 +244,7 @@ describe('Acceptance: ember-cli-typescript generator', function () {
243244 const tsconfig = file ( 'tsconfig.json' ) ;
244245 expect ( tsconfig ) . to . exist ;
245246
246- const json = JSON . parse ( tsconfig . content ) ;
247+ const json = ts . parseConfigFileTextToJson ( ' tsconfig.json' , tsconfig . content ) . config ;
247248 expect ( json . compilerOptions . paths ) . to . deep . equal ( {
248249 'my-app/tests/*' : [ 'tests/*' ] ,
249250 'my-app/mirage/*' : [ 'mirage/*' ] ,
@@ -269,7 +270,7 @@ describe('Acceptance: ember-cli-typescript generator', function () {
269270 const tsconfig = file ( 'tsconfig.json' ) ;
270271 expect ( tsconfig ) . to . exist ;
271272
272- const json = JSON . parse ( tsconfig . content ) ;
273+ const json = ts . parseConfigFileTextToJson ( ' tsconfig.json' , tsconfig . content ) . config ;
273274 expect ( json . compilerOptions . paths ) . to . deep . equal ( {
274275 'dummy/tests/*' : [ 'tests/*' ] ,
275276 'dummy/mirage/*' : [ 'tests/dummy/mirage/*' ] ,
0 commit comments