test(ivy): enable //packages/bazel/test/ngc-wrapped/... tests for Ivy (#27470)

This commit allows //packages/bazel/test/ngc-wrapped/... tests to run
under Ivy mode. To get them to pass, it addresses a problem with the
way the tests are configured: both test targets have sloppy .d.ts
dependencies configured, leading to many type errors being generated
in TypeScript for the .d.ts files.

Due to the way ngc directs TypeScript emit, it avoids type-checking
.d.ts files and thus this issue does not surface. ngtsc does a whole-
program emit which results in full .d.ts type-checking by default,
catching this configuration issue.

To fix this, skipLibCheck is added to the tsconfig.jsons for these
tests, which tells TypeScript to skip type-checking of the .d.ts files,
avoiding this problem in a similar way to ngc.

PR Close #27470
This commit is contained in:
Alex Rickabaugh 2018-12-04 17:22:19 -08:00 committed by Igor Minar
parent 0d8ab323a7
commit 8f425701e4
4 changed files with 4 additions and 3 deletions

View File

@ -5,7 +5,6 @@ package(default_visibility = ["//packages/bazel/test:__subpackages__"])
ng_module(
name = "empty",
srcs = ["empty.ts"],
tags = ["fixme-ivy-aot"], # FW-741: ngtsc breaks tsc module resolution
tsconfig = ":tsconfig.json",
deps = [
"//packages/core",

View File

@ -2,6 +2,7 @@
"compilerOptions": {
"paths": {
"@angular/core": ["../../../../dist/packages/core"]
}
},
"skipLibCheck": true
}
}

View File

@ -17,7 +17,7 @@ describe('ngc_wrapped', () => {
// fixmeIvy placeholder to prevent jasmine from erroring out because there are no specs
it('should be removed once the fixmeIvy below is resolved', () => {});
fixmeIvy('FW-741: ngtsc breaks tsc module resolution').it('should work', () => {
it('should work', () => {
const {read, write, runOneBuild, writeConfig, shouldExist, basePath} = setup();
write('some_project/index.ts', `

View File

@ -55,6 +55,7 @@ export function createTsConfig(options: TsConfigOptions) {
// declaration in the same tsconfig.json, otherwise ts will error.
'declaration': true,
'declarationDir': options.outDir,
'skipLibCheck': true,
},
'bazelOptions': {
...result.bazelOptions,