refactor(ivy): verify template type check options are compatible (#34195)

It is now an error if '"fullTemplateTypeCheck"' is disabled while
`"strictTemplates"` is enabled, as enabling the latter implies that the
former is also enabled.

PR Close #34195
This commit is contained in:
JoostK
2019-12-02 21:38:48 +01:00
committed by Alex Rickabaugh
parent ac67c5b1f8
commit d5e0073efd
4 changed files with 74 additions and 0 deletions

View File

@ -1552,6 +1552,41 @@ export declare class AnimationEvent {
});
});
});
describe('option compatibility verification', () => {
beforeEach(() => env.write('index.ts', `export const a = 1;`));
it('should error if "fullTemplateTypeCheck" is false when "strictTemplates" is true', () => {
env.tsconfig({fullTemplateTypeCheck: false, strictTemplates: true});
const diags = env.driveDiagnostics();
expect(diags.length).toBe(1);
expect(diags[0].messageText)
.toContain(
'Angular compiler option "strictTemplates" is enabled, however "fullTemplateTypeCheck" is disabled.');
});
it('should not error if "fullTemplateTypeCheck" is false when "strictTemplates" is false',
() => {
env.tsconfig({fullTemplateTypeCheck: false, strictTemplates: false});
const diags = env.driveDiagnostics();
expect(diags.length).toBe(0);
});
it('should not error if "fullTemplateTypeCheck" is not set when "strictTemplates" is true',
() => {
env.tsconfig({strictTemplates: true});
const diags = env.driveDiagnostics();
expect(diags.length).toBe(0);
});
it('should not error if "fullTemplateTypeCheck" is true set when "strictTemplates" is true',
() => {
env.tsconfig({strictTemplates: true});
const diags = env.driveDiagnostics();
expect(diags.length).toBe(0);
});
});
});
});