test(compiler-cli): disable one TypeChecker test on Windows due to path sensitivity issue (#38294)

This commit disables one TypeChecker test (added as a part of
https://github.com/angular/angular/pull/38105) which make assertions about the filename while
running on Windows.

Such assertions are currently suffering from a case sensitivity issue.

PR Close #38294
This commit is contained in:
Andrew Kushnir 2020-07-29 17:05:21 -07:00 committed by Alex Rickabaugh
parent 8effc83b92
commit 1eebb7f189
1 changed files with 41 additions and 35 deletions

View File

@ -6,6 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/
import {platform} from 'os';
import {ErrorCode, ngErrorCode} from '../../diagnostics';
import {absoluteFrom, absoluteFromSourceFile, getSourceFileOrError} from '../../file_system';
import {runInEachFileSystem} from '../../file_system/testing';
@ -13,7 +15,7 @@ import {OptimizeFor} from '../api';
import {getClass, setup, TestDeclaration} from './test_utils';
runInEachFileSystem(() => {
runInEachFileSystem(os => {
describe('TemplateTypeChecker', () => {
it('should batch diagnostic operations when requested in WholeProgram mode', () => {
const file1 = absoluteFrom('/file1.ts');
@ -169,6 +171,9 @@ runInEachFileSystem(() => {
expect(diags[0].code).toBe(ngErrorCode(ErrorCode.INLINE_TCB_REQUIRED));
});
// These tests are currently disabled when running in Windows mode as the assertions involving
// the filename attached to the diagnostic are suffering from a case-sensitivity issue.
if (os !== 'Windows' && platform() !== 'win32') {
it('should produce errors for components that require type constructor inlining', () => {
const fileName = absoluteFrom('/main.ts');
const dirFile = absoluteFrom('/dir.ts');
@ -201,13 +206,14 @@ runInEachFileSystem(() => {
expect(diags.length).toBe(1);
expect(diags[0].code).toBe(ngErrorCode(ErrorCode.INLINE_TYPE_CTOR_REQUIRED));
// The relatedInformation of the diagnostic should point to the directive which required the
// inline type constructor.
// The relatedInformation of the diagnostic should point to the directive which required
// the inline type constructor.
expect(diags[0].relatedInformation).not.toBeUndefined();
expect(diags[0].relatedInformation!.length).toBe(1);
expect(diags[0].relatedInformation![0].file).not.toBeUndefined();
expect(absoluteFromSourceFile(diags[0].relatedInformation![0].file!)).toBe(dirFile);
});
}
});
describe('template overrides', () => {