From 199acf4dff804e7f55bb26948181632369e1cbaf Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Wed, 29 Apr 2020 08:15:40 -0700 Subject: [PATCH] test: be explicit about which types are used in ts_project tests This prevents @types packages added to the root package.json from inadvertently breaking tests on buildkite Windows CI where there is no sandboxing. --- internal/linker/test/local/fit/tsconfig.json | 3 ++- internal/node/test/lib2/tsconfig.json | 6 +++++- internal/node/test/tsconfig.json | 3 +++ internal/pkg_npm/test/linking/fub/tsconfig.json | 3 ++- internal/pkg_npm/test/linking/fuz/tsconfig.json | 3 ++- internal/pkg_npm/test/linking/tsconfig.json | 3 ++- packages/rollup/test/integration/far/a/b/c/tsconfig.json | 3 ++- packages/rollup/test/integration/far/a/tsconfig.json | 3 ++- packages/rollup/test/integration/foo/tsconfig.json | 3 ++- packages/rollup/test/integration/foo_a/tsconfig.json | 3 ++- packages/rollup/test/integration/foo_aaa/tsconfig.json | 3 ++- packages/typescript/src/checked_in_ts_project.bzl | 1 + packages/typescript/test/ts_project/b/tsconfig-test.json | 3 +++ .../test/ts_project/empty_intermediate/tsconfig-a.json | 5 ++++- .../test/ts_project/empty_intermediate/tsconfig-b.json | 5 ++++- .../test/ts_project/empty_intermediate/tsconfig-c.json | 1 + packages/typescript/test/ts_project/rootdir/tsconfig.json | 6 +++++- packages/typescript/test/ts_project/simple/tsconfig.json | 6 +++++- packages/typescript/test/ts_project/tsconfig-base.json | 1 + .../typescript/test/ts_project/validation/tsconfig.json | 1 + 20 files changed, 51 insertions(+), 14 deletions(-) diff --git a/internal/linker/test/local/fit/tsconfig.json b/internal/linker/test/local/fit/tsconfig.json index 8f1cc9cec2..67dcdc9d6a 100644 --- a/internal/linker/test/local/fit/tsconfig.json +++ b/internal/linker/test/local/fit/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { - "declaration": true + "declaration": true, + "types": [] } } \ No newline at end of file diff --git a/internal/node/test/lib2/tsconfig.json b/internal/node/test/lib2/tsconfig.json index 9e26dfeeb6..7812f071fb 100644 --- a/internal/node/test/lib2/tsconfig.json +++ b/internal/node/test/lib2/tsconfig.json @@ -1 +1,5 @@ -{} \ No newline at end of file +{ + "compilerOptions": { + "types": ["node"] + } +} diff --git a/internal/node/test/tsconfig.json b/internal/node/test/tsconfig.json index 346e6cea95..d6e80d862e 100644 --- a/internal/node/test/tsconfig.json +++ b/internal/node/test/tsconfig.json @@ -1,3 +1,6 @@ { + "compilerOptions": { + "types": [] + }, "include": ["main.ts"] } diff --git a/internal/pkg_npm/test/linking/fub/tsconfig.json b/internal/pkg_npm/test/linking/fub/tsconfig.json index 8f1cc9cec2..67dcdc9d6a 100644 --- a/internal/pkg_npm/test/linking/fub/tsconfig.json +++ b/internal/pkg_npm/test/linking/fub/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { - "declaration": true + "declaration": true, + "types": [] } } \ No newline at end of file diff --git a/internal/pkg_npm/test/linking/fuz/tsconfig.json b/internal/pkg_npm/test/linking/fuz/tsconfig.json index 8f1cc9cec2..67dcdc9d6a 100644 --- a/internal/pkg_npm/test/linking/fuz/tsconfig.json +++ b/internal/pkg_npm/test/linking/fuz/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { - "declaration": true + "declaration": true, + "types": [] } } \ No newline at end of file diff --git a/internal/pkg_npm/test/linking/tsconfig.json b/internal/pkg_npm/test/linking/tsconfig.json index daf7a99a6b..1407858ebd 100644 --- a/internal/pkg_npm/test/linking/tsconfig.json +++ b/internal/pkg_npm/test/linking/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { - "declaration": true + "declaration": true, + "types": [] }, "include": ["*.ts"] } \ No newline at end of file diff --git a/packages/rollup/test/integration/far/a/b/c/tsconfig.json b/packages/rollup/test/integration/far/a/b/c/tsconfig.json index 80eaf79ad3..11d727c958 100644 --- a/packages/rollup/test/integration/far/a/b/c/tsconfig.json +++ b/packages/rollup/test/integration/far/a/b/c/tsconfig.json @@ -4,6 +4,7 @@ "strict": true, "target": "es2015", "module": "esnext", - "moduleResolution": "node" + "moduleResolution": "node", + "types": [] } } diff --git a/packages/rollup/test/integration/far/a/tsconfig.json b/packages/rollup/test/integration/far/a/tsconfig.json index 04b8f8124d..09f8350a7e 100644 --- a/packages/rollup/test/integration/far/a/tsconfig.json +++ b/packages/rollup/test/integration/far/a/tsconfig.json @@ -4,7 +4,8 @@ "strict": true, "target": "es2015", "module": "esnext", - "moduleResolution": "node" + "moduleResolution": "node", + "types": [] }, // For Windows, which is not sand-boxed, we need to limit // the typescript files included so the "@far/a" compilation diff --git a/packages/rollup/test/integration/foo/tsconfig.json b/packages/rollup/test/integration/foo/tsconfig.json index 80eaf79ad3..11d727c958 100644 --- a/packages/rollup/test/integration/foo/tsconfig.json +++ b/packages/rollup/test/integration/foo/tsconfig.json @@ -4,6 +4,7 @@ "strict": true, "target": "es2015", "module": "esnext", - "moduleResolution": "node" + "moduleResolution": "node", + "types": [] } } diff --git a/packages/rollup/test/integration/foo_a/tsconfig.json b/packages/rollup/test/integration/foo_a/tsconfig.json index 80eaf79ad3..11d727c958 100644 --- a/packages/rollup/test/integration/foo_a/tsconfig.json +++ b/packages/rollup/test/integration/foo_a/tsconfig.json @@ -4,6 +4,7 @@ "strict": true, "target": "es2015", "module": "esnext", - "moduleResolution": "node" + "moduleResolution": "node", + "types": [] } } diff --git a/packages/rollup/test/integration/foo_aaa/tsconfig.json b/packages/rollup/test/integration/foo_aaa/tsconfig.json index 80eaf79ad3..11d727c958 100644 --- a/packages/rollup/test/integration/foo_aaa/tsconfig.json +++ b/packages/rollup/test/integration/foo_aaa/tsconfig.json @@ -4,6 +4,7 @@ "strict": true, "target": "es2015", "module": "esnext", - "moduleResolution": "node" + "moduleResolution": "node", + "types": [] } } diff --git a/packages/typescript/src/checked_in_ts_project.bzl b/packages/typescript/src/checked_in_ts_project.bzl index aafbb4f555..86aefa9b15 100644 --- a/packages/typescript/src/checked_in_ts_project.bzl +++ b/packages/typescript/src/checked_in_ts_project.bzl @@ -31,6 +31,7 @@ def checked_in_ts_project(name, src, checked_in_js = None, **kwargs): module = "commonjs", removeComments = True, declaration = True, + skipLibCheck = True, ), files = ["/".join([workspace_root, native.package_name(), src])], ).to_json()], diff --git a/packages/typescript/test/ts_project/b/tsconfig-test.json b/packages/typescript/test/ts_project/b/tsconfig-test.json index 288ba2408c..f71d6d2250 100644 --- a/packages/typescript/test/ts_project/b/tsconfig-test.json +++ b/packages/typescript/test/ts_project/b/tsconfig-test.json @@ -1,5 +1,8 @@ { "extends": "../tsconfig-base.json", + "compilerOptions": { + "types": ["jasmine", "node"] + }, "references": [ {"path": "./"} ], diff --git a/packages/typescript/test/ts_project/empty_intermediate/tsconfig-a.json b/packages/typescript/test/ts_project/empty_intermediate/tsconfig-a.json index 3563bd1c00..7bafa424da 100644 --- a/packages/typescript/test/ts_project/empty_intermediate/tsconfig-a.json +++ b/packages/typescript/test/ts_project/empty_intermediate/tsconfig-a.json @@ -1,3 +1,6 @@ { - "files": ["a.d.ts"] + "files": ["a.d.ts"], + "compilerOptions": { + "types": [] + } } \ No newline at end of file diff --git a/packages/typescript/test/ts_project/empty_intermediate/tsconfig-b.json b/packages/typescript/test/ts_project/empty_intermediate/tsconfig-b.json index 6f5fba878a..3b87315842 100644 --- a/packages/typescript/test/ts_project/empty_intermediate/tsconfig-b.json +++ b/packages/typescript/test/ts_project/empty_intermediate/tsconfig-b.json @@ -1,3 +1,6 @@ { - "files": [] + "files": [], + "compilerOptions": { + "types": [] + } } \ No newline at end of file diff --git a/packages/typescript/test/ts_project/empty_intermediate/tsconfig-c.json b/packages/typescript/test/ts_project/empty_intermediate/tsconfig-c.json index dcdbec4409..f0b748b3d5 100644 --- a/packages/typescript/test/ts_project/empty_intermediate/tsconfig-c.json +++ b/packages/typescript/test/ts_project/empty_intermediate/tsconfig-c.json @@ -11,5 +11,6 @@ "../../../../../bazel-out/k8-dbg/bin/packages/typescript/test/ts_project/empty_intermediate", "../../../../../bazel-out/x64_windows-dbg/bin/packages/typescript/test/ts_project/empty_intermediate", ], + "types": [] } } \ No newline at end of file diff --git a/packages/typescript/test/ts_project/rootdir/tsconfig.json b/packages/typescript/test/ts_project/rootdir/tsconfig.json index 0967ef424b..e98f617914 100644 --- a/packages/typescript/test/ts_project/rootdir/tsconfig.json +++ b/packages/typescript/test/ts_project/rootdir/tsconfig.json @@ -1 +1,5 @@ -{} +{ + "compilerOptions": { + "types": [] + } +} \ No newline at end of file diff --git a/packages/typescript/test/ts_project/simple/tsconfig.json b/packages/typescript/test/ts_project/simple/tsconfig.json index 0967ef424b..e98f617914 100644 --- a/packages/typescript/test/ts_project/simple/tsconfig.json +++ b/packages/typescript/test/ts_project/simple/tsconfig.json @@ -1 +1,5 @@ -{} +{ + "compilerOptions": { + "types": [] + } +} \ No newline at end of file diff --git a/packages/typescript/test/ts_project/tsconfig-base.json b/packages/typescript/test/ts_project/tsconfig-base.json index 11a249c71d..f55cc65503 100644 --- a/packages/typescript/test/ts_project/tsconfig-base.json +++ b/packages/typescript/test/ts_project/tsconfig-base.json @@ -18,5 +18,6 @@ "../../../../bazel-out/k8-dbg/bin/packages/typescript/test/ts_project", "../../../../bazel-out/x64_windows-dbg/bin/packages/typescript/test/ts_project", ], + "types": [] } } \ No newline at end of file diff --git a/packages/typescript/test/ts_project/validation/tsconfig.json b/packages/typescript/test/ts_project/validation/tsconfig.json index 19c65db5a6..c37be6a0d4 100644 --- a/packages/typescript/test/ts_project/validation/tsconfig.json +++ b/packages/typescript/test/ts_project/validation/tsconfig.json @@ -5,5 +5,6 @@ "declarationMap": true, "declaration": true, "sourceMap": true, + "types": [] } } \ No newline at end of file