From 6ec7f8a21ff30c73417355e1cfdbe9e8be74f37a Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Wed, 14 Aug 2019 00:01:13 -0500 Subject: [PATCH] test: coverage for tsconfig deps sandbox bug see https://github.com/angular/angular/pull/31943 --- packages/typescript/test/tsconfig_extends/BUILD.bazel | 9 ++++++++- .../test/tsconfig_extends/tsconfig-base.json | 10 ++-------- .../test/tsconfig_extends/tsconfig-root.json | 9 +++++++++ 3 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 packages/typescript/test/tsconfig_extends/tsconfig-root.json diff --git a/packages/typescript/test/tsconfig_extends/BUILD.bazel b/packages/typescript/test/tsconfig_extends/BUILD.bazel index 36412cbc00..d55a852057 100644 --- a/packages/typescript/test/tsconfig_extends/BUILD.bazel +++ b/packages/typescript/test/tsconfig_extends/BUILD.bazel @@ -19,10 +19,17 @@ load("@npm_bazel_typescript//:index.from_src.bzl", "ts_library") # ts_library to include the extended tsconfig file in compilations. # The ts_library rule will generate its own tsconfig which extends from the # src file. +# Also test that a ts_config can have a dep on another ts_config ts_config( name = "tsconfig", src = "tsconfig.json", - deps = ["tsconfig-base.json"], + deps = [":tsconfig_base"], +) + +ts_config( + name = "tsconfig_base", + src = "tsconfig-base.json", + deps = [":tsconfig-root.json"], ) ts_library( diff --git a/packages/typescript/test/tsconfig_extends/tsconfig-base.json b/packages/typescript/test/tsconfig_extends/tsconfig-base.json index 9aa1316ff0..639961ebd0 100644 --- a/packages/typescript/test/tsconfig_extends/tsconfig-base.json +++ b/packages/typescript/test/tsconfig_extends/tsconfig-base.json @@ -1,9 +1,3 @@ { - "compilerOptions": { - "lib": ["es2015.promise", "es5"], - // Explicitly set types settings so typescript doesn't auto-discover types. - // If all types are discovered then all types need to be included as deps - // or typescript may error out with TS2688: Cannot find type definition file for 'foo'. - "types": [] - } -} \ No newline at end of file + "extends": "./tsconfig-root" +} diff --git a/packages/typescript/test/tsconfig_extends/tsconfig-root.json b/packages/typescript/test/tsconfig_extends/tsconfig-root.json new file mode 100644 index 0000000000..9aa1316ff0 --- /dev/null +++ b/packages/typescript/test/tsconfig_extends/tsconfig-root.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "lib": ["es2015.promise", "es5"], + // Explicitly set types settings so typescript doesn't auto-discover types. + // If all types are discovered then all types need to be included as deps + // or typescript may error out with TS2688: Cannot find type definition file for 'foo'. + "types": [] + } +} \ No newline at end of file