From 3eec314ba9df0087afeb1044cfd87d0346fdc726 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Thu, 7 Feb 2019 19:02:57 +0200 Subject: [PATCH] test(ivy): fix `ngtools_api` test under ivy (#28542) PR Close #28542 --- packages/compiler-cli/test/ngtools_api_spec.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/compiler-cli/test/ngtools_api_spec.ts b/packages/compiler-cli/test/ngtools_api_spec.ts index 63ce319c17..7f3f97250c 100644 --- a/packages/compiler-cli/test/ngtools_api_spec.ts +++ b/packages/compiler-cli/test/ngtools_api_spec.ts @@ -7,7 +7,7 @@ */ import {__NGTOOLS_PRIVATE_API_2 as NgTools_InternalApi_NG_2} from '@angular/compiler-cli'; -import {fixmeIvy} from '@angular/private/testing'; +import {fixmeIvy, ivyEnabled} from '@angular/private/testing'; import * as path from 'path'; import * as ts from 'typescript'; @@ -19,7 +19,7 @@ describe('ngtools_api (deprecated)', () => { beforeEach(() => { testSupport = setup(); }); function createProgram(rootNames: string[]) { - const options = testSupport.createCompilerOptions(); + const options = testSupport.createCompilerOptions({enableIvy: ivyEnabled && 'ngtsc'}); const host = ts.createCompilerHost(options, true); const program = ts.createProgram(rootNames.map(p => path.resolve(testSupport.basePath, p)), options, host); @@ -62,7 +62,8 @@ describe('ngtools_api (deprecated)', () => { fixmeIvy('FW-629: ngtsc lists lazy routes').it('should list lazy routes recursively', () => { writeSomeRoutes(); - const {program, host, options} = createProgram(['src/main.ts']); + const {program, host, options} = + createProgram(['src/main.ts', 'src/child.ts', 'src/child2.ts']); const routes = NgTools_InternalApi_NG_2.listLazyRoutes({ program, host, @@ -77,7 +78,8 @@ describe('ngtools_api (deprecated)', () => { it('should allow to emit the program after analyzing routes', () => { writeSomeRoutes(); - const {program, host, options} = createProgram(['src/main.ts']); + const {program, host, options} = + createProgram(['src/main.ts', 'src/child.ts', 'src/child2.ts']); NgTools_InternalApi_NG_2.listLazyRoutes({ program, host,