diff --git a/packages/animations/browser/test/BUILD.bazel b/packages/animations/browser/test/BUILD.bazel index 4d46b7c1ae..36b06e16ee 100644 --- a/packages/animations/browser/test/BUILD.bazel +++ b/packages/animations/browser/test/BUILD.bazel @@ -16,10 +16,11 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/animations/test/BUILD.bazel b/packages/animations/test/BUILD.bazel index 2b5e4e288b..ce00fd01a7 100644 --- a/packages/animations/test/BUILD.bazel +++ b/packages/animations/test/BUILD.bazel @@ -13,10 +13,11 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/bazel/src/schematics/BUILD.bazel b/packages/bazel/src/schematics/BUILD.bazel index a51a76767d..15f8f5a4aa 100644 --- a/packages/bazel/src/schematics/BUILD.bazel +++ b/packages/bazel/src/schematics/BUILD.bazel @@ -12,11 +12,12 @@ filegroup( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ "//packages/bazel/src/schematics/ng-add:test", "//packages/bazel/src/schematics/ng-new:test", "//packages/bazel/src/schematics/utility:test", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/benchpress/test/BUILD.bazel b/packages/benchpress/test/BUILD.bazel index ea75062fab..7b89609fb4 100644 --- a/packages/benchpress/test/BUILD.bazel +++ b/packages/benchpress/test/BUILD.bazel @@ -15,12 +15,13 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//packages/benchpress", "//packages/core/testing", "//tools/testing:node", + "//tools/testing:node_es5", "@npm//protractor", ], ) diff --git a/packages/common/http/test/BUILD.bazel b/packages/common/http/test/BUILD.bazel index 65eadfbb96..a37e1741d7 100644 --- a/packages/common/http/test/BUILD.bazel +++ b/packages/common/http/test/BUILD.bazel @@ -19,10 +19,11 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/common/http/testing/test/BUILD.bazel b/packages/common/http/testing/test/BUILD.bazel index d9de470171..3aff5b14d3 100644 --- a/packages/common/http/testing/test/BUILD.bazel +++ b/packages/common/http/testing/test/BUILD.bazel @@ -17,10 +17,11 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/common/test/BUILD.bazel b/packages/common/test/BUILD.bazel index 87e8552355..613031ca40 100644 --- a/packages/common/test/BUILD.bazel +++ b/packages/common/test/BUILD.bazel @@ -24,10 +24,11 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/common/upgrade/test/BUILD.bazel b/packages/common/upgrade/test/BUILD.bazel index 12462680c8..9e9b56167e 100644 --- a/packages/common/upgrade/test/BUILD.bazel +++ b/packages/common/upgrade/test/BUILD.bazel @@ -16,9 +16,10 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/compiler-cli/integrationtest/bazel/injectable_def/app/test/BUILD.bazel b/packages/compiler-cli/integrationtest/bazel/injectable_def/app/test/BUILD.bazel index 6999d6c26a..c734409217 100644 --- a/packages/compiler-cli/integrationtest/bazel/injectable_def/app/test/BUILD.bazel +++ b/packages/compiler-cli/integrationtest/bazel/injectable_def/app/test/BUILD.bazel @@ -21,12 +21,13 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//packages/platform-server", "//packages/platform-server/testing", "//packages/private/testing", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/compiler-cli/integrationtest/bazel/injector_def/ivy_build/app/test/BUILD.bazel b/packages/compiler-cli/integrationtest/bazel/injector_def/ivy_build/app/test/BUILD.bazel index ab1ed5eb0b..b373b4cb48 100644 --- a/packages/compiler-cli/integrationtest/bazel/injector_def/ivy_build/app/test/BUILD.bazel +++ b/packages/compiler-cli/integrationtest/bazel/injector_def/ivy_build/app/test/BUILD.bazel @@ -22,12 +22,13 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], tags = [ "ivy-only", ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/compiler-cli/ngcc/test/BUILD.bazel b/packages/compiler-cli/ngcc/test/BUILD.bazel index 8166e70b85..d7b53adfe0 100644 --- a/packages/compiler-cli/ngcc/test/BUILD.bazel +++ b/packages/compiler-cli/ngcc/test/BUILD.bazel @@ -33,13 +33,13 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], data = [ "//packages/compiler-cli/test/ngtsc/fake_core:npm_package", ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) @@ -64,7 +64,6 @@ ts_library( jasmine_node_test( name = "integration", timeout = "long", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], data = [ "//packages/common:npm_package", "//packages/core:npm_package", @@ -75,9 +74,10 @@ jasmine_node_test( # Disabled in AOT mode because we want ngcc to compile non-AOT Angular packages. "no-ivy-aot", ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":integration_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", "@npm//canonical-path", "@npm//convert-source-map", ], diff --git a/packages/compiler-cli/src/ngtsc/annotations/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/annotations/test/BUILD.bazel index ac632ecd04..e6a1ebd716 100644 --- a/packages/compiler-cli/src/ngtsc/annotations/test/BUILD.bazel +++ b/packages/compiler-cli/src/ngtsc/annotations/test/BUILD.bazel @@ -29,9 +29,9 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/compiler-cli/src/ngtsc/cycles/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/cycles/test/BUILD.bazel index e95443472f..d95434faa0 100644 --- a/packages/compiler-cli/src/ngtsc/cycles/test/BUILD.bazel +++ b/packages/compiler-cli/src/ngtsc/cycles/test/BUILD.bazel @@ -21,9 +21,9 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/compiler-cli/src/ngtsc/entry_point/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/entry_point/test/BUILD.bazel index 03c4b93867..ef595d45ee 100644 --- a/packages/compiler-cli/src/ngtsc/entry_point/test/BUILD.bazel +++ b/packages/compiler-cli/src/ngtsc/entry_point/test/BUILD.bazel @@ -19,9 +19,9 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/compiler-cli/src/ngtsc/file_system/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/file_system/test/BUILD.bazel index 84ea6a2849..a84c321523 100644 --- a/packages/compiler-cli/src/ngtsc/file_system/test/BUILD.bazel +++ b/packages/compiler-cli/src/ngtsc/file_system/test/BUILD.bazel @@ -18,9 +18,9 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/compiler-cli/src/ngtsc/imports/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/imports/test/BUILD.bazel index 7b36f38e5e..5c35f76a07 100644 --- a/packages/compiler-cli/src/ngtsc/imports/test/BUILD.bazel +++ b/packages/compiler-cli/src/ngtsc/imports/test/BUILD.bazel @@ -22,9 +22,9 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/compiler-cli/src/ngtsc/indexer/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/indexer/test/BUILD.bazel index cc98a4fbab..050f641cc2 100644 --- a/packages/compiler-cli/src/ngtsc/indexer/test/BUILD.bazel +++ b/packages/compiler-cli/src/ngtsc/indexer/test/BUILD.bazel @@ -23,9 +23,9 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/compiler-cli/src/ngtsc/partial_evaluator/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/partial_evaluator/test/BUILD.bazel index 11c584fa0f..ec5d9b848a 100644 --- a/packages/compiler-cli/src/ngtsc/partial_evaluator/test/BUILD.bazel +++ b/packages/compiler-cli/src/ngtsc/partial_evaluator/test/BUILD.bazel @@ -24,9 +24,9 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/compiler-cli/src/ngtsc/reflection/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/reflection/test/BUILD.bazel index b786eade07..c99d53bdb1 100644 --- a/packages/compiler-cli/src/ngtsc/reflection/test/BUILD.bazel +++ b/packages/compiler-cli/src/ngtsc/reflection/test/BUILD.bazel @@ -20,9 +20,9 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/compiler-cli/src/ngtsc/scope/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/scope/test/BUILD.bazel index 4869bbf684..4f2c3e3556 100644 --- a/packages/compiler-cli/src/ngtsc/scope/test/BUILD.bazel +++ b/packages/compiler-cli/src/ngtsc/scope/test/BUILD.bazel @@ -24,9 +24,9 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/compiler-cli/src/ngtsc/shims/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/shims/test/BUILD.bazel index de435dc818..ff3b3ae3f0 100644 --- a/packages/compiler-cli/src/ngtsc/shims/test/BUILD.bazel +++ b/packages/compiler-cli/src/ngtsc/shims/test/BUILD.bazel @@ -17,9 +17,9 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/compiler-cli/src/ngtsc/transform/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/transform/test/BUILD.bazel index 9346799eff..ca3f71a02e 100644 --- a/packages/compiler-cli/src/ngtsc/transform/test/BUILD.bazel +++ b/packages/compiler-cli/src/ngtsc/transform/test/BUILD.bazel @@ -24,9 +24,8 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], + bootstrap = ["//tools/testing:node_no_angular_es5"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", ], ) diff --git a/packages/compiler-cli/src/ngtsc/typecheck/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/typecheck/test/BUILD.bazel index a48813d7ad..1095455226 100644 --- a/packages/compiler-cli/src/ngtsc/typecheck/test/BUILD.bazel +++ b/packages/compiler-cli/src/ngtsc/typecheck/test/BUILD.bazel @@ -24,9 +24,9 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/compiler-cli/src/ngtsc/util/test/BUILD.bazel b/packages/compiler-cli/src/ngtsc/util/test/BUILD.bazel index a4ca97b5af..afd93119be 100644 --- a/packages/compiler-cli/src/ngtsc/util/test/BUILD.bazel +++ b/packages/compiler-cli/src/ngtsc/util/test/BUILD.bazel @@ -20,9 +20,9 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/compiler-cli/test/BUILD.bazel b/packages/compiler-cli/test/BUILD.bazel index 3c651e6540..3b93ae4062 100644 --- a/packages/compiler-cli/test/BUILD.bazel +++ b/packages/compiler-cli/test/BUILD.bazel @@ -40,7 +40,6 @@ ts_library( jasmine_node_test( name = "extract_i18n", - bootstrap = ["angular/tools/testing/init_node_spec.js"], data = [ "//packages/core:npm_package", ], @@ -49,11 +48,13 @@ jasmine_node_test( # tool will likely work differently. "no-ivy-aot", ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":extract_i18n_lib", "//packages/common:npm_package", "//packages/core", "//tools/testing:node", + "//tools/testing:node_es5", "@npm//minimist", ], ) @@ -76,7 +77,6 @@ ts_library( jasmine_node_test( name = "ngc", timeout = "long", # 900 seconds - bootstrap = ["angular/tools/testing/init_node_spec.js"], data = [ "//packages/common:npm_package", "//packages/core:npm_package", @@ -88,10 +88,12 @@ jasmine_node_test( # own tests under //packages/compiler-cli/test/ngtsc. "no-ivy-aot", ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":ngc_lib", "//packages/core", "//tools/testing:node", + "//tools/testing:node_es5", "@npm//minimist", "@npm//rxjs", "@npm//tsickle", @@ -116,14 +118,15 @@ ts_library( jasmine_node_test( name = "perform_watch", - bootstrap = ["angular/tools/testing/init_node_spec.js"], data = [ "//packages/core:npm_package", ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":perform_watch_lib", "//packages/core", "//tools/testing:node", + "//tools/testing:node_es5", ], ) @@ -143,13 +146,14 @@ ts_library( jasmine_node_test( name = "perform_compile", - bootstrap = ["angular/tools/testing/init_node_spec.js"], data = [ "//packages/core:npm_package", ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":perform_compile_lib", "//packages/core", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/compiler-cli/test/compliance/BUILD.bazel b/packages/compiler-cli/test/compliance/BUILD.bazel index ad3a15b865..4376113e42 100644 --- a/packages/compiler-cli/test/compliance/BUILD.bazel +++ b/packages/compiler-cli/test/compliance/BUILD.bazel @@ -18,7 +18,6 @@ ts_library( jasmine_node_test( name = "compliance", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], data = [ "//packages/compiler-cli/test/ngtsc/fake_core:npm_package", ], @@ -26,8 +25,9 @@ jasmine_node_test( tags = [ "ivy-only", ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/compiler-cli/test/diagnostics/BUILD.bazel b/packages/compiler-cli/test/diagnostics/BUILD.bazel index be2cece23f..be532176ae 100644 --- a/packages/compiler-cli/test/diagnostics/BUILD.bazel +++ b/packages/compiler-cli/test/diagnostics/BUILD.bazel @@ -15,7 +15,6 @@ ts_library( jasmine_node_test( name = "check_types", timeout = "long", # 900 seconds - bootstrap = ["angular/tools/testing/init_node_spec.js"], data = [ "//packages/common:npm_package", "//packages/core:npm_package", @@ -25,10 +24,12 @@ jasmine_node_test( # compiler has its own typechecking implementation and tests. "no-ivy-aot", ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":check_types_lib", "//packages/core", "//tools/testing:node", + "//tools/testing:node_es5", ], ) @@ -45,11 +46,10 @@ ts_library( jasmine_node_test( name = "typescript_version", - bootstrap = ["angular/tools/testing/init_node_spec.js"], - data = [ - ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":typescript_version_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/compiler-cli/test/metadata/BUILD.bazel b/packages/compiler-cli/test/metadata/BUILD.bazel index 8fe58d3d1e..948b2ae195 100644 --- a/packages/compiler-cli/test/metadata/BUILD.bazel +++ b/packages/compiler-cli/test/metadata/BUILD.bazel @@ -16,12 +16,13 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], data = [ ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//packages/core", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/compiler-cli/test/ngtsc/BUILD.bazel b/packages/compiler-cli/test/ngtsc/BUILD.bazel index c9ceca5077..a04f658deb 100644 --- a/packages/compiler-cli/test/ngtsc/BUILD.bazel +++ b/packages/compiler-cli/test/ngtsc/BUILD.bazel @@ -23,14 +23,14 @@ ts_library( jasmine_node_test( name = "ngtsc", timeout = "long", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], data = [ "//packages/compiler-cli/test/ngtsc/fake_core:npm_package", ], shard_count = 4, + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":ngtsc_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", "@npm//minimist", ], ) diff --git a/packages/compiler-cli/test/transformers/BUILD.bazel b/packages/compiler-cli/test/transformers/BUILD.bazel index 8c9b603f4f..245858cf0d 100644 --- a/packages/compiler-cli/test/transformers/BUILD.bazel +++ b/packages/compiler-cli/test/transformers/BUILD.bazel @@ -19,7 +19,6 @@ ts_library( jasmine_node_test( name = "test", timeout = "long", # 900 seconds - bootstrap = ["angular/tools/testing/init_node_spec.js"], data = [ "//packages/common:npm_package", "//packages/core:npm_package", @@ -30,10 +29,12 @@ jasmine_node_test( # of these transformer utilities. "no-ivy-aot", ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//packages/core", "//tools/testing:node", + "//tools/testing:node_es5", "@npm//source-map", ], ) diff --git a/packages/compiler/test/BUILD.bazel b/packages/compiler/test/BUILD.bazel index dd3c84969a..357bb2e322 100644 --- a/packages/compiler/test/BUILD.bazel +++ b/packages/compiler/test/BUILD.bazel @@ -70,7 +70,6 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], data = [ "//packages/animations:npm_package", "//packages/common:npm_package", @@ -80,10 +79,12 @@ jasmine_node_test( # Disabled as these tests pertain to the old ngc compilation and are not relevant in Ivy. "no-ivy-aot", ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", ":test_node_only_lib", "//tools/testing:node", + "//tools/testing:node_es5", "@npm//base64-js", "@npm//source-map", ], diff --git a/packages/compiler/test/css_parser/BUILD.bazel b/packages/compiler/test/css_parser/BUILD.bazel index b70fa84c8d..ec6c66eab0 100644 --- a/packages/compiler/test/css_parser/BUILD.bazel +++ b/packages/compiler/test/css_parser/BUILD.bazel @@ -16,10 +16,11 @@ ts_library( jasmine_node_test( name = "css_parser", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":css_parser_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/compiler/test/expression_parser/BUILD.bazel b/packages/compiler/test/expression_parser/BUILD.bazel index 9ef9fa8704..3f1b032c4d 100644 --- a/packages/compiler/test/expression_parser/BUILD.bazel +++ b/packages/compiler/test/expression_parser/BUILD.bazel @@ -15,10 +15,11 @@ ts_library( jasmine_node_test( name = "expression_parser", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":expression_parser_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/compiler/test/ml_parser/BUILD.bazel b/packages/compiler/test/ml_parser/BUILD.bazel index 0569cef2ba..e399b5f2d7 100644 --- a/packages/compiler/test/ml_parser/BUILD.bazel +++ b/packages/compiler/test/ml_parser/BUILD.bazel @@ -13,10 +13,11 @@ ts_library( jasmine_node_test( name = "ml_parser", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":ml_parser_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/compiler/test/render3/BUILD.bazel b/packages/compiler/test/render3/BUILD.bazel index 25a50c2acb..d6a0769da9 100644 --- a/packages/compiler/test/render3/BUILD.bazel +++ b/packages/compiler/test/render3/BUILD.bazel @@ -18,9 +18,10 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/compiler/test/selector/BUILD.bazel b/packages/compiler/test/selector/BUILD.bazel index 7353eb1f3d..5d49d1abbc 100644 --- a/packages/compiler/test/selector/BUILD.bazel +++ b/packages/compiler/test/selector/BUILD.bazel @@ -17,10 +17,11 @@ ts_library( jasmine_node_test( name = "selector", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":selector_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/core/test/BUILD.bazel b/packages/core/test/BUILD.bazel index ab2ad8f7fa..eed634e303 100644 --- a/packages/core/test/BUILD.bazel +++ b/packages/core/test/BUILD.bazel @@ -59,8 +59,8 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], shard_count = 4, + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", ":test_node_only_lib", @@ -68,6 +68,7 @@ jasmine_node_test( "//packages/platform-server/testing", "//packages/zone.js/lib:zone_d_ts", "//tools/testing:node", + "//tools/testing:node_es5", "@npm//base64-js", "@npm//source-map", ], diff --git a/packages/core/test/acceptance/BUILD.bazel b/packages/core/test/acceptance/BUILD.bazel index cc87ecc34a..65bb7eeb21 100644 --- a/packages/core/test/acceptance/BUILD.bazel +++ b/packages/core/test/acceptance/BUILD.bazel @@ -37,11 +37,12 @@ ts_library( jasmine_node_test( name = "acceptance", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":acceptance_lib", "//packages/zone.js/lib:zone_d_ts", "//tools/testing:node", + "//tools/testing:node_es5", "@npm//base64-js", "@npm//source-map", ], diff --git a/packages/core/test/render3/BUILD.bazel b/packages/core/test/render3/BUILD.bazel index 6323d85252..fd33e052e1 100644 --- a/packages/core/test/render3/BUILD.bazel +++ b/packages/core/test/render3/BUILD.bazel @@ -61,10 +61,10 @@ ts_library( jasmine_node_test( name = "render3", - bootstrap = [ - "angular/packages/core/test/render3/load_domino", - ], + templated_args = ["--node_options=--require=$(rlocation $(location :domino_es5))"], deps = [ + ":domino", + ":domino_es5", ":render3_node_lib", "//packages/zone.js/lib", ], diff --git a/packages/core/test/render3/ivy/BUILD.bazel b/packages/core/test/render3/ivy/BUILD.bazel index 9855dfd764..a35b6ae234 100644 --- a/packages/core/test/render3/ivy/BUILD.bazel +++ b/packages/core/test/render3/ivy/BUILD.bazel @@ -16,15 +16,14 @@ ts_library( jasmine_node_test( name = "ivy", - bootstrap = [ - "angular/packages/core/test/render3/load_domino", - ], tags = [ "ivy-only", ], + templated_args = ["--node_options=--require=$(rlocation $(location //packages/core/test/render3:domino_es5))"], deps = [ ":ivy_lib", "//packages/core/test/render3:domino", + "//packages/core/test/render3:domino_es5", "//packages/zone.js/lib", ], ) diff --git a/packages/core/test/render3/load_domino.ts b/packages/core/test/render3/load_domino.ts index 8d9d549640..06eaacb5a4 100644 --- a/packages/core/test/render3/load_domino.ts +++ b/packages/core/test/render3/load_domino.ts @@ -6,6 +6,15 @@ * found in the LICENSE file at https://angular.io/license */ +if (process.env['TEST_SRCDIR']) { + // bootstrap the bazel require resolve patch since this + // script is a bootstrap script loaded with --node_options=--require=... + const path = require('path'); + require(path.posix.join( + process.env['TEST_SRCDIR'], process.env['TEST_WORKSPACE'], + (process.env['TEST_BINARY'] as string).replace(/\.(sh|bat)$/, '_loader.js'), )); +} + // Needed to run animation tests import 'zone.js/lib/node/rollup-main'; import '@angular/compiler'; // For JIT mode. Must be in front of any other @angular/* imports. diff --git a/packages/core/test/view/BUILD.bazel b/packages/core/test/view/BUILD.bazel index 481f1bcdf1..b1345c912c 100644 --- a/packages/core/test/view/BUILD.bazel +++ b/packages/core/test/view/BUILD.bazel @@ -34,14 +34,15 @@ ts_library( jasmine_node_test( name = "view", - bootstrap = ["angular/tools/testing/init_node_spec.js"], tags = [ "no-ivy-aot", ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":view_lib", ":view_node_only_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/examples/core/BUILD.bazel b/packages/examples/core/BUILD.bazel index fce592cd19..98a46a423a 100644 --- a/packages/examples/core/BUILD.bazel +++ b/packages/examples/core/BUILD.bazel @@ -78,9 +78,10 @@ protractor_web_test_suite( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":core_tests_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/examples/core/testing/ts/BUILD.bazel b/packages/examples/core/testing/ts/BUILD.bazel index cbfb89fcca..c9076e5c54 100644 --- a/packages/examples/core/testing/ts/BUILD.bazel +++ b/packages/examples/core/testing/ts/BUILD.bazel @@ -15,9 +15,10 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":fake_async_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/forms/test/BUILD.bazel b/packages/forms/test/BUILD.bazel index 679a2af5c0..3e71cc2ac8 100644 --- a/packages/forms/test/BUILD.bazel +++ b/packages/forms/test/BUILD.bazel @@ -20,10 +20,11 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/http/test/BUILD.bazel b/packages/http/test/BUILD.bazel index f7d5d2bc1d..ad9bbebbf3 100644 --- a/packages/http/test/BUILD.bazel +++ b/packages/http/test/BUILD.bazel @@ -20,10 +20,11 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/localize/schematics/ng-add/BUILD.bazel b/packages/localize/schematics/ng-add/BUILD.bazel index 20bce8ad46..a2ca2bcd27 100644 --- a/packages/localize/schematics/ng-add/BUILD.bazel +++ b/packages/localize/schematics/ng-add/BUILD.bazel @@ -43,9 +43,10 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/localize/src/localize/test/BUILD.bazel b/packages/localize/src/localize/test/BUILD.bazel index 94cde285ef..1751925a5a 100644 --- a/packages/localize/src/localize/test/BUILD.bazel +++ b/packages/localize/src/localize/test/BUILD.bazel @@ -14,11 +14,9 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = [ - "angular/tools/testing/init_node_no_angular_spec.js", - ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/localize/src/tools/test/BUILD.bazel b/packages/localize/src/tools/test/BUILD.bazel index dea2fea294..294dbaca09 100644 --- a/packages/localize/src/tools/test/BUILD.bazel +++ b/packages/localize/src/tools/test/BUILD.bazel @@ -22,12 +22,10 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = [ - "angular/tools/testing/init_node_no_angular_spec.js", - ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", "@npm//glob", ], ) diff --git a/packages/localize/src/tools/test/translate/integration/BUILD.bazel b/packages/localize/src/tools/test/translate/integration/BUILD.bazel index 9f2eeabf1a..c082ada410 100644 --- a/packages/localize/src/tools/test/translate/integration/BUILD.bazel +++ b/packages/localize/src/tools/test/translate/integration/BUILD.bazel @@ -14,18 +14,16 @@ ts_library( jasmine_node_test( name = "integration", - bootstrap = [ - "angular/tools/testing/init_node_no_angular_spec.js", - ], data = glob( [ "locales/**", "test_files/**", ], ), + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", "@npm//glob", "@npm//yargs", ], diff --git a/packages/localize/src/utils/test/BUILD.bazel b/packages/localize/src/utils/test/BUILD.bazel index aaf43dcf63..8390849a2a 100644 --- a/packages/localize/src/utils/test/BUILD.bazel +++ b/packages/localize/src/utils/test/BUILD.bazel @@ -14,11 +14,9 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = [ - "angular/tools/testing/init_node_no_angular_spec.js", - ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/localize/test/BUILD.bazel b/packages/localize/test/BUILD.bazel index 13381b2dad..8db773173c 100644 --- a/packages/localize/test/BUILD.bazel +++ b/packages/localize/test/BUILD.bazel @@ -16,11 +16,9 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = [ - "angular/tools/testing/init_node_no_angular_spec.js", - ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"], deps = [ ":test_lib", - "//tools/testing:node_no_angular", + "//tools/testing:node_no_angular_es5", ], ) diff --git a/packages/platform-browser-dynamic/test/BUILD.bazel b/packages/platform-browser-dynamic/test/BUILD.bazel index 0d54237df5..5bfa0bcd0b 100644 --- a/packages/platform-browser-dynamic/test/BUILD.bazel +++ b/packages/platform-browser-dynamic/test/BUILD.bazel @@ -18,10 +18,11 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/platform-browser/animations/test/BUILD.bazel b/packages/platform-browser/animations/test/BUILD.bazel index 4af17f10ba..8835133c33 100644 --- a/packages/platform-browser/animations/test/BUILD.bazel +++ b/packages/platform-browser/animations/test/BUILD.bazel @@ -24,10 +24,11 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/platform-browser/test/BUILD.bazel b/packages/platform-browser/test/BUILD.bazel index 150d014521..2c14cd335e 100644 --- a/packages/platform-browser/test/BUILD.bazel +++ b/packages/platform-browser/test/BUILD.bazel @@ -29,10 +29,11 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/platform-server/test/BUILD.bazel b/packages/platform-server/test/BUILD.bazel index 187430ed56..bd371d35b9 100644 --- a/packages/platform-server/test/BUILD.bazel +++ b/packages/platform-server/test/BUILD.bazel @@ -22,11 +22,12 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], tags = [ ], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/platform-webworker/test/BUILD.bazel b/packages/platform-webworker/test/BUILD.bazel index f4c2211f22..c111faa7f1 100644 --- a/packages/platform-webworker/test/BUILD.bazel +++ b/packages/platform-webworker/test/BUILD.bazel @@ -21,10 +21,11 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/router/test/BUILD.bazel b/packages/router/test/BUILD.bazel index 30e62191e2..d4bf152368 100644 --- a/packages/router/test/BUILD.bazel +++ b/packages/router/test/BUILD.bazel @@ -23,10 +23,11 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/router/test/aot_ngsummary_test/BUILD.bazel b/packages/router/test/aot_ngsummary_test/BUILD.bazel index fc804c6b82..8ab47431b0 100644 --- a/packages/router/test/aot_ngsummary_test/BUILD.bazel +++ b/packages/router/test/aot_ngsummary_test/BUILD.bazel @@ -27,9 +27,10 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":aot_test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/service-worker/config/test/BUILD.bazel b/packages/service-worker/config/test/BUILD.bazel index f133a418b5..27c30ad4ff 100644 --- a/packages/service-worker/config/test/BUILD.bazel +++ b/packages/service-worker/config/test/BUILD.bazel @@ -14,11 +14,12 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//packages/service-worker/config", "//packages/service-worker/config/testing", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/service-worker/test/BUILD.bazel b/packages/service-worker/test/BUILD.bazel index ad498fde3d..02ae61548c 100644 --- a/packages/service-worker/test/BUILD.bazel +++ b/packages/service-worker/test/BUILD.bazel @@ -18,10 +18,11 @@ ts_library( jasmine_node_test( name = "test", - bootstrap = ["angular/tools/testing/init_node_spec.js"], + templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"], deps = [ ":test_lib", "//tools/testing:node", + "//tools/testing:node_es5", ], ) diff --git a/packages/zone.js/test/BUILD.bazel b/packages/zone.js/test/BUILD.bazel index 6c30bd4810..ac4561a830 100644 --- a/packages/zone.js/test/BUILD.bazel +++ b/packages/zone.js/test/BUILD.bazel @@ -68,8 +68,6 @@ ts_library( testonly = True, srcs = glob(["node/*.ts"]) + [ "node-env-setup.ts", - "node_entry_point.ts", - "node_entry_point_no_patch_clock.ts", "test-env-setup-jasmine-no-patch-clock.ts", ], deps = [ @@ -85,12 +83,45 @@ ts_library( ], ) +ts_library( + name = "node_entry_point", + testonly = True, + srcs = ["node_entry_point.ts"], + deps = [ + ":common_spec_env", + ":common_spec_srcs", + ":common_spec_util", + "//packages/zone.js/lib", + "@npm//@types/shelljs", + "@npm//@types/systemjs", + "@npm//rxjs", + "@npm//shelljs", + "@npm//systemjs", + ], +) + +ts_library( + name = "node_entry_point_no_patch_clock", + testonly = True, + srcs = ["node_entry_point_no_patch_clock.ts"], + deps = [ + ":common_spec_env", + ":common_spec_srcs", + ":common_spec_util", + "//packages/zone.js/lib", + "@npm//@types/shelljs", + "@npm//@types/systemjs", + "@npm//rxjs", + "@npm//shelljs", + "@npm//systemjs", + ], +) + ts_library( name = "bluebird_spec", testonly = True, srcs = [ "extra/bluebird.spec.ts", - "node_bluebird_entry_point.ts", ], deps = [ ":common_spec_env", @@ -100,13 +131,33 @@ ts_library( ) ts_library( - name = "error_spec", + name = "node_bluebird_entry_point", testonly = True, - srcs = [ - "node_error_disable_policy_entry_point.ts", - "node_error_entry_point.ts", - "node_error_lazy_policy_entry_point.ts", + srcs = ["node_bluebird_entry_point.ts"], + deps = [ + ":common_spec_env", + "//packages/zone.js/lib", + "@npm//bluebird", ], +) + +ts_library( + name = "node_error_disable_policy_entry_point", + testonly = True, + srcs = ["node_error_disable_policy_entry_point.ts"], + deps = [ + ":common_spec_env", + ":common_spec_util", + ":error_spec_srcs", + ":node_error_entry_point", + "//packages/zone.js/lib", + ], +) + +ts_library( + name = "node_error_entry_point", + testonly = True, + srcs = ["node_error_entry_point.ts"], deps = [ ":common_spec_env", ":common_spec_util", @@ -115,53 +166,61 @@ ts_library( ], ) +ts_library( + name = "node_error_lazy_policy_entry_point", + testonly = True, + srcs = ["node_error_lazy_policy_entry_point.ts"], + deps = [ + ":common_spec_env", + ":common_spec_util", + ":error_spec_srcs", + ":node_error_entry_point", + "//packages/zone.js/lib", + ], +) + jasmine_node_test( name = "test_node", - bootstrap = [ - "angular/packages/zone.js/test/node_entry_point.js", - ], + templated_args = ["--node_options=--require=$(rlocation $(location :node_entry_point_es5))"], deps = [ + ":node_entry_point_es5", ":test_node_lib", ], ) jasmine_node_test( name = "test_node_no_jasmine_clock", - bootstrap = [ - "angular/packages/zone.js/test/node_entry_point_no_patch_clock.js", - ], + templated_args = ["--node_options=--require=$(rlocation $(location :node_entry_point_no_patch_clock_es5))"], deps = [ + ":node_entry_point_no_patch_clock_es5", ":test_node_lib", ], ) jasmine_node_test( name = "test_node_bluebird", - bootstrap = [ - "angular/packages/zone.js/test/node_bluebird_entry_point.js", - ], + templated_args = ["--node_options=--require=$(rlocation $(location :node_bluebird_entry_point_es5))"], deps = [ ":bluebird_spec", + ":node_bluebird_entry_point_es5", ], ) jasmine_node_test( name = "test_node_error_disable_policy", - bootstrap = [ - "angular/packages/zone.js/test/node_error_disable_policy_entry_point.js", - ], + templated_args = ["--node_options=--require=$(rlocation $(location :node_error_disable_policy_entry_point_es5))"], deps = [ - ":error_spec", + ":node_error_disable_policy_entry_point", + ":node_error_disable_policy_entry_point_es5", ], ) jasmine_node_test( name = "test_node_error_lazy_policy", - bootstrap = [ - "angular/packages/zone.js/test/node_error_lazy_policy_entry_point.js", - ], + templated_args = ["--node_options=--require=$(rlocation $(location :node_error_lazy_policy_entry_point_es5))"], deps = [ - ":error_spec", + ":node_error_lazy_policy_entry_point", + ":node_error_lazy_policy_entry_point_es5", ], ) diff --git a/packages/zone.js/test/node_bluebird_entry_point.ts b/packages/zone.js/test/node_bluebird_entry_point.ts index ae0da24027..7406499b54 100644 --- a/packages/zone.js/test/node_bluebird_entry_point.ts +++ b/packages/zone.js/test/node_bluebird_entry_point.ts @@ -6,6 +6,15 @@ * found in the LICENSE file at https://angular.io/license */ +if (process.env['TEST_SRCDIR']) { + // bootstrap the bazel require resolve patch since this + // script is a bootstrap script loaded with --node_options=--require=... + const path = require('path'); + require(path.posix.join( + process.env['TEST_SRCDIR'], process.env['TEST_WORKSPACE'], + (process.env['TEST_BINARY'] as string).replace(/\.(sh|bat)$/, '_loader.js'), )); +} + // Must be loaded before zone loads, so that zone can detect WTF. import './test_fake_polyfill'; diff --git a/packages/zone.js/test/node_entry_point.ts b/packages/zone.js/test/node_entry_point.ts index e63e7595d6..c3b3a436e9 100644 --- a/packages/zone.js/test/node_entry_point.ts +++ b/packages/zone.js/test/node_entry_point.ts @@ -13,6 +13,15 @@ * found in the LICENSE file at https://angular.io/license */ +if (process.env['TEST_SRCDIR']) { + // bootstrap the bazel require resolve patch since this + // script is a bootstrap script loaded with --node_options=--require=... + const path = require('path'); + require(path.posix.join( + process.env['TEST_SRCDIR'], process.env['TEST_WORKSPACE'], + (process.env['TEST_BINARY'] as string).replace(/\.(sh|bat)$/, '_loader.js'), )); +} + // Must be loaded before zone loads, so that zone can detect WTF. import './node-env-setup'; import './test_fake_polyfill'; diff --git a/packages/zone.js/test/node_entry_point_no_patch_clock.ts b/packages/zone.js/test/node_entry_point_no_patch_clock.ts index a91766407f..a6b24aa7b4 100644 --- a/packages/zone.js/test/node_entry_point_no_patch_clock.ts +++ b/packages/zone.js/test/node_entry_point_no_patch_clock.ts @@ -13,6 +13,15 @@ * found in the LICENSE file at https://angular.io/license */ +if (process.env['TEST_SRCDIR']) { + // bootstrap the bazel require resolve patch since this + // script is a bootstrap script loaded with --node_options=--require=... + const path = require('path'); + require(path.posix.join( + process.env['TEST_SRCDIR'], process.env['TEST_WORKSPACE'], + (process.env['TEST_BINARY'] as string).replace(/\.(sh|bat)$/, '_loader.js'), )); +} + // Must be loaded before zone loads, so that zone can detect WTF. import './node-env-setup'; import './test_fake_polyfill'; diff --git a/packages/zone.js/test/node_error_disable_policy_entry_point.ts b/packages/zone.js/test/node_error_disable_policy_entry_point.ts index 841039900d..1158768f44 100644 --- a/packages/zone.js/test/node_error_disable_policy_entry_point.ts +++ b/packages/zone.js/test/node_error_disable_policy_entry_point.ts @@ -6,6 +6,15 @@ * found in the LICENSE file at https://angular.io/license */ +if (process.env['TEST_SRCDIR']) { + // bootstrap the bazel require resolve patch since this + // script is a bootstrap script loaded with --node_options=--require=... + const path = require('path'); + require(path.posix.join( + process.env['TEST_SRCDIR'], process.env['TEST_WORKSPACE'], + (process.env['TEST_BINARY'] as string).replace(/\.(sh|bat)$/, '_loader.js'), )); +} + process.env['errorpolicy'] = (global as any)['__Zone_Error_BlacklistedStackFrames_policy'] = 'disable'; import './node_error_entry_point'; diff --git a/packages/zone.js/test/node_error_lazy_policy_entry_point.ts b/packages/zone.js/test/node_error_lazy_policy_entry_point.ts index 61b5e56093..70c57c0549 100644 --- a/packages/zone.js/test/node_error_lazy_policy_entry_point.ts +++ b/packages/zone.js/test/node_error_lazy_policy_entry_point.ts @@ -6,5 +6,14 @@ * found in the LICENSE file at https://angular.io/license */ +if (process.env['TEST_SRCDIR']) { + // bootstrap the bazel require resolve patch since this + // script is a bootstrap script loaded with --node_options=--require=... + const path = require('path'); + require(path.posix.join( + process.env['TEST_SRCDIR'], process.env['TEST_WORKSPACE'], + (process.env['TEST_BINARY'] as string).replace(/\.(sh|bat)$/, '_loader.js'), )); +} + process.env['errorpolicy'] = (global as any)['__Zone_Error_BlacklistedStackFrames_policy'] = 'lazy'; import './node_error_entry_point'; diff --git a/tools/defaults.bzl b/tools/defaults.bzl index c761e3e78d..aec19d7cf6 100644 --- a/tools/defaults.bzl +++ b/tools/defaults.bzl @@ -1,6 +1,6 @@ """Re-export of some bazel rules with repository-wide defaults.""" -load("@build_bazel_rules_nodejs//:index.bzl", _nodejs_binary = "nodejs_binary", _npm_package = "npm_package") +load("@build_bazel_rules_nodejs//:index.bzl", _nodejs_binary = "nodejs_binary", _pkg_npm = "pkg_npm") load("@npm_bazel_jasmine//:index.bzl", _jasmine_node_test = "jasmine_node_test") load("@npm_bazel_karma//:index.bzl", _karma_web_test = "karma_web_test", _karma_web_test_suite = "karma_web_test_suite") load("@npm_bazel_typescript//:index.bzl", _ts_devserver = "ts_devserver", _ts_library = "ts_library") @@ -93,7 +93,7 @@ def ts_devserver(**kwargs): **kwargs ) -def ts_library(tsconfig = None, testonly = False, deps = [], module_name = None, **kwargs): +def ts_library(name, tsconfig = None, testonly = False, deps = [], module_name = None, **kwargs): """Default values for ts_library""" deps = deps + ["@npm//tslib"] if testonly: @@ -108,6 +108,7 @@ def ts_library(tsconfig = None, testonly = False, deps = [], module_name = None, module_name = _default_module_name(testonly) _ts_library( + name = name, tsconfig = tsconfig, testonly = testonly, deps = deps, @@ -115,6 +116,17 @@ def ts_library(tsconfig = None, testonly = False, deps = [], module_name = None, **kwargs ) + # Select the es5 .js output of the ts_library for use in downstream boostrap targets + # with `output_group = "es5_sources"`. This exposes an internal detail of ts_library + # that is not ideal. + # TODO(gregmagolan): clean this up by using tsc() in these cases rather than ts_library + native.filegroup( + name = "%s_es5" % name, + srcs = [":%s" % name], + testonly = testonly, + output_group = "es5_sources", + ) + def ng_module(name, tsconfig = None, entry_point = None, testonly = False, deps = [], module_name = None, bundle_dts = True, **kwargs): """Default values for ng_module""" deps = deps + ["@npm//tslib"] diff --git a/tools/testing/init_node_spec.ts b/tools/testing/init_node_spec.ts index 7a0aa0eec6..0c8dbdebef 100644 --- a/tools/testing/init_node_spec.ts +++ b/tools/testing/init_node_spec.ts @@ -6,6 +6,15 @@ * found in the LICENSE file at https://angular.io/license */ +if (process.env['TEST_SRCDIR']) { + // bootstrap the bazel require resolve patch since this + // script is a bootstrap script loaded with --node_options=--require=... + const path = require('path'); + require(path.posix.join( + process.env['TEST_SRCDIR'], process.env['TEST_WORKSPACE'], + (process.env['TEST_BINARY'] as string).replace(/\.(sh|bat)$/, '_loader.js'), )); +} + import 'zone.js/lib/node/rollup-main'; import 'zone.js/lib/zone-spec/long-stack-trace'; import 'zone.js/lib/zone-spec/task-tracking'; diff --git a/tools/ts-api-guardian/BUILD.bazel b/tools/ts-api-guardian/BUILD.bazel index 045b44d0ec..7841891db7 100644 --- a/tools/ts-api-guardian/BUILD.bazel +++ b/tools/ts-api-guardian/BUILD.bazel @@ -55,7 +55,10 @@ pkg_npm( ts_library( name = "test_lib", testonly = True, - srcs = glob(["test/*.ts"]), + srcs = glob( + ["test/*.ts"], + exclude = ["test/bootstrap.ts"], + ), tsconfig = "//tools:tsconfig-test", deps = [ ":lib", @@ -68,18 +71,40 @@ ts_library( ], ) +ts_library( + name = "bootstrap", + testonly = True, + srcs = ["test/bootstrap.ts"], + tsconfig = "//tools:tsconfig-test", + deps = ["@npm//@types/node"], +) + +# Select the es5 .js output of the ts_library :boostrap target +# with `output_group = "es5_sources"` for use in the jasmine_node_test +# below. This exposes an internal detail of ts_library that is not ideal. +# TODO(gregmagolan): clean this up by using tsc() in this case rather than ts_library +filegroup( + name = "bootstrap_es5", + testonly = True, + srcs = [":bootstrap"], + output_group = "es5_sources", +) + jasmine_node_test( name = "tests", - srcs = [":test_lib"], - bootstrap = ["angular/tools/ts-api-guardian/test/bootstrap.js"], + srcs = [ + ":test_lib", + ], data = glob([ "test/fixtures/*.ts", "test/fixtures/*.patch", ]) + [ + ":bootstrap_es5", ":ts-api-guardian", # TODO: remove this once the boostrap.js workaround has been removed. ":package.json", ], + templated_args = ["--node_options=--require=$(rlocation $(location :bootstrap_es5))"], ) # END-INTERNAL