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
This commit is contained in:
Keen Yee Liau 2020-05-12 08:19:58 +01:00 committed by Kara Erickson
parent a32cbed89c
commit b58bd2bb91
1 changed files with 4 additions and 3 deletions

View File

@ -170,9 +170,10 @@ describe('TypeScriptServiceHost', () => {
tsLSHost.override('/app/test.ng', '<div></div>');
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);
});