Skip to content

fix(@schematics/angular): add skipLibCheck to workspace tsconfig #16682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import { Architect } from '@angular-devkit/architect';
import { TestLogger } from '@angular-devkit/architect/testing';
import { join, virtualFs } from '@angular-devkit/core';
import { debounceTime, takeWhile, tap } from 'rxjs/operators';
import { timer } from 'rxjs';
import { debounceTime, map, switchMap, takeWhile, tap } from 'rxjs/operators';
import { browserBuild, createArchitect, host, outputPath } from '../utils';


Expand Down Expand Up @@ -140,15 +141,14 @@ describe('Browser Builder Web Worker support', () => {
const workerPath = join(outputPath, '0.worker.js');
let workerContent = '';

const run = await architect.scheduleTarget(target, overrides);
await run.output.pipe(
// Wait for files to be written to disk.
// FIXME: Not quite sure why such a long 'debounceTime' is needed.
// Anything under `2500` is a constant failure locally when using
// 'fdescribe' and this tests doesn't run as first one and is also rather flaky on CI.
// It seems that the outputted files contents don't get updated in time.
debounceTime(2500),
tap((buildEvent) => expect(buildEvent.success).toBe(true, 'build should succeed')),
// The current linux-based CI environments may not fully settled in regards to filesystem
// changes from previous tests which reuse the same directory and fileset.
// The initial delay helps mitigate false positive rebuild triggers in such scenarios.
const { run } = await timer(1000).pipe(
switchMap(() => architect.scheduleTarget(target, overrides)),
switchMap(run => run.output.pipe(map(output => ({ run, output })))),
debounceTime(500),
tap(({ output }) => expect(output.success).toBe(true, 'build should succeed')),
tap(() => {
switch (phase) {
case 1:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"noImplicitThis": true,
"noFallthroughCasesInSwitch": true,
"strictNullChecks": true,<% } %>
"skipLibCheck": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
Expand Down
1 change: 1 addition & 0 deletions scripts/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const knownFlakes = [
// Rebuild tests in test-large are flakey if not run as the first suite.
// https://github.com/angular/angular-cli/pull/15204
'packages/angular_devkit/build_angular/test/browser/rebuild_spec_large.ts',
'packages/angular_devkit/build_angular/test/browser/web-worker_spec_large.ts',
];

const projectBaseDir = join(__dirname, '..');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"skipLibCheck": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"skipLibCheck": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"skipLibCheck": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"skipLibCheck": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
Expand Down
11 changes: 11 additions & 0 deletions tests/legacy-cli/e2e/tests/build/skip-lib-check.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { ng } from '../../utils/process';
import { createProject, updateTsConfig } from '../../utils/project';


export default async function() {
await createProject('strict-workspace-test-project', '--strict');
await updateTsConfig(json => {
json['compilerOptions']['skipLibCheck'] = false;
});
await ng('build');
}