From b58bd2bb91341ba62575048ec9ca168fe4f08884 Mon Sep 17 00:00:00 2001 From: Keen Yee Liau Date: Tue, 12 May 2020 08:19:58 +0100 Subject: [PATCH] test(language-service): external template update should not invalidate program (#36989) In TypeScript 3.9, the compiler is able to re-use (i.e. not invalidate) the previous program if only external templates (i.e. no TS files) have changed. PR Close #36989 --- packages/language-service/test/typescript_host_spec.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/language-service/test/typescript_host_spec.ts b/packages/language-service/test/typescript_host_spec.ts index 80682966b8..3bfa306da7 100644 --- a/packages/language-service/test/typescript_host_spec.ts +++ b/packages/language-service/test/typescript_host_spec.ts @@ -170,9 +170,10 @@ describe('TypeScriptServiceHost', () => { tsLSHost.override('/app/test.ng', '
'); const newModules = ngLSHost.getAnalyzedModules(); const newProgram = ngLSHost.program; - // Assert that the program has changed because external template was updated - expect(newProgram).not.toBe(oldProgram); - // But, analyzed modules should remain the same because none of the source + // The program should not have changed since external templates are not part of + // the TS source files. This is an improvement in TS 3.9 over previous versions. + expect(newProgram).toBe(oldProgram); + // And also analyzed modules should remain the same because none of the source // files have changed. expect(newModules).toBe(oldModules); });