Revert "refactor: handle breaking changes in rules_nodejs 1.0.0 (#34589)" (#34730)

This reverts commit 9bb349e1c8.

PR Close #34730
This commit is contained in:
atscott 2020-01-10 13:40:02 -08:00
parent 7e9ac7650b
commit 538d0446b5
69 changed files with 131 additions and 318 deletions

View File

@ -16,11 +16,10 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -13,11 +13,10 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -12,12 +12,11 @@ filegroup(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
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",
],
)

View File

@ -15,13 +15,12 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//packages/benchpress",
"//packages/core/testing",
"//tools/testing:node",
"//tools/testing:node_es5",
"@npm//protractor",
],
)

View File

@ -19,11 +19,10 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -17,11 +17,10 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -24,11 +24,10 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -16,10 +16,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -21,13 +21,12 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//packages/platform-server",
"//packages/platform-server/testing",
"//packages/private/testing",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -22,13 +22,12 @@ 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",
],
)

View File

@ -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_es5",
"//tools/testing:node_no_angular",
],
)
@ -64,6 +64,7 @@ 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",
@ -74,10 +75,9 @@ 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_es5",
"//tools/testing:node_no_angular",
"@npm//canonical-path",
"@npm//convert-source-map",
],

View File

@ -29,9 +29,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -21,9 +21,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -19,9 +19,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -18,9 +18,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -22,9 +22,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -23,9 +23,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -24,9 +24,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -20,9 +20,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -24,9 +24,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -17,9 +17,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -24,9 +24,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -20,9 +20,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -40,6 +40,7 @@ ts_library(
jasmine_node_test(
name = "extract_i18n",
bootstrap = ["angular/tools/testing/init_node_spec.js"],
data = [
"//packages/core:npm_package",
],
@ -48,13 +49,11 @@ 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",
],
)
@ -77,6 +76,7 @@ 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,12 +88,10 @@ 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",
@ -118,15 +116,14 @@ 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",
],
)
@ -146,14 +143,13 @@ 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",
],
)

View File

@ -18,6 +18,7 @@ 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",
],
@ -25,9 +26,8 @@ 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_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -15,6 +15,7 @@ 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",
@ -24,12 +25,10 @@ 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",
],
)
@ -46,10 +45,11 @@ ts_library(
jasmine_node_test(
name = "typescript_version",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
data = [
],
deps = [
":typescript_version_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -16,13 +16,12 @@ 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",
],
)

View File

@ -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_es5",
"//tools/testing:node_no_angular",
"@npm//minimist",
],
)

View File

@ -19,6 +19,7 @@ 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",
@ -29,12 +30,10 @@ 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",
],
)

View File

@ -70,6 +70,7 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_spec.js"],
data = [
"//packages/animations:npm_package",
"//packages/common:npm_package",
@ -79,12 +80,10 @@ 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",
],

View File

@ -16,11 +16,10 @@ ts_library(
jasmine_node_test(
name = "css_parser",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":css_parser_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -15,11 +15,10 @@ ts_library(
jasmine_node_test(
name = "expression_parser",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":expression_parser_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -13,11 +13,10 @@ ts_library(
jasmine_node_test(
name = "ml_parser",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":ml_parser_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -18,10 +18,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -17,11 +17,10 @@ ts_library(
jasmine_node_test(
name = "selector",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":selector_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -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,7 +68,6 @@ 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",
],

View File

@ -37,12 +37,11 @@ ts_library(
jasmine_node_test(
name = "acceptance",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":acceptance_lib",
"//packages/zone.js/lib:zone_d_ts",
"//tools/testing:node",
"//tools/testing:node_es5",
"@npm//base64-js",
"@npm//source-map",
],

View File

@ -61,10 +61,10 @@ ts_library(
jasmine_node_test(
name = "render3",
templated_args = ["--node_options=--require=$(rlocation $(location :domino_es5))"],
bootstrap = [
"angular/packages/core/test/render3/load_domino",
],
deps = [
":domino",
":domino_es5",
":render3_node_lib",
"//packages/zone.js/lib",
],

View File

@ -16,14 +16,15 @@ 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",
],
)

View File

@ -6,15 +6,6 @@
* 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.

View File

@ -34,15 +34,14 @@ 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",
],
)

View File

@ -78,10 +78,9 @@ protractor_web_test_suite(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":core_tests_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -15,10 +15,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":fake_async_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -20,11 +20,10 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -20,11 +20,10 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -43,10 +43,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -14,9 +14,11 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = [
"angular/tools/testing/init_node_no_angular_spec.js",
],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -22,10 +22,12 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = [
"angular/tools/testing/init_node_no_angular_spec.js",
],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
"@npm//glob",
],
)

View File

@ -14,16 +14,18 @@ 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_es5",
"//tools/testing:node_no_angular",
"@npm//glob",
"@npm//yargs",
],

View File

@ -14,9 +14,11 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = [
"angular/tools/testing/init_node_no_angular_spec.js",
],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -16,9 +16,11 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
bootstrap = [
"angular/tools/testing/init_node_no_angular_spec.js",
],
deps = [
":test_lib",
"//tools/testing:node_no_angular_es5",
"//tools/testing:node_no_angular",
],
)

View File

@ -18,11 +18,10 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -24,11 +24,10 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -29,11 +29,10 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -22,12 +22,11 @@ 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",
],
)

View File

@ -21,11 +21,10 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -23,11 +23,10 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -27,10 +27,9 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":aot_test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -14,12 +14,11 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//packages/service-worker/config",
"//packages/service-worker/config/testing",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -18,11 +18,10 @@ ts_library(
jasmine_node_test(
name = "test",
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -68,6 +68,8 @@ 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 = [
@ -83,45 +85,12 @@ 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",
@ -131,96 +100,68 @@ ts_library(
)
ts_library(
name = "node_bluebird_entry_point",
name = "error_spec",
testonly = True,
srcs = ["node_bluebird_entry_point.ts"],
deps = [
":common_spec_env",
"//packages/zone.js/lib",
"@npm//bluebird",
srcs = [
"node_error_disable_policy_entry_point.ts",
"node_error_entry_point.ts",
"node_error_lazy_policy_entry_point.ts",
],
)
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",
":error_spec_srcs",
"//packages/zone.js/lib",
],
)
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",
templated_args = ["--node_options=--require=$(rlocation $(location :node_entry_point_es5))"],
bootstrap = [
"angular/packages/zone.js/test/node_entry_point.js",
],
deps = [
":node_entry_point_es5",
":test_node_lib",
],
)
jasmine_node_test(
name = "test_node_no_jasmine_clock",
templated_args = ["--node_options=--require=$(rlocation $(location :node_entry_point_no_patch_clock_es5))"],
bootstrap = [
"angular/packages/zone.js/test/node_entry_point_no_patch_clock.js",
],
deps = [
":node_entry_point_no_patch_clock_es5",
":test_node_lib",
],
)
jasmine_node_test(
name = "test_node_bluebird",
templated_args = ["--node_options=--require=$(rlocation $(location :node_bluebird_entry_point_es5))"],
bootstrap = [
"angular/packages/zone.js/test/node_bluebird_entry_point.js",
],
deps = [
":bluebird_spec",
":node_bluebird_entry_point_es5",
],
)
jasmine_node_test(
name = "test_node_error_disable_policy",
templated_args = ["--node_options=--require=$(rlocation $(location :node_error_disable_policy_entry_point_es5))"],
bootstrap = [
"angular/packages/zone.js/test/node_error_disable_policy_entry_point.js",
],
deps = [
":node_error_disable_policy_entry_point",
":node_error_disable_policy_entry_point_es5",
":error_spec",
],
)
jasmine_node_test(
name = "test_node_error_lazy_policy",
templated_args = ["--node_options=--require=$(rlocation $(location :node_error_lazy_policy_entry_point_es5))"],
bootstrap = [
"angular/packages/zone.js/test/node_error_lazy_policy_entry_point.js",
],
deps = [
":node_error_lazy_policy_entry_point",
":node_error_lazy_policy_entry_point_es5",
":error_spec",
],
)

View File

@ -6,15 +6,6 @@
* 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';

View File

@ -13,15 +13,6 @@
* 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';

View File

@ -13,15 +13,6 @@
* 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';

View File

@ -6,15 +6,6 @@
* 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';

View File

@ -6,14 +6,5 @@
* 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';

View File

@ -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", _pkg_npm = "pkg_npm")
load("@build_bazel_rules_nodejs//:index.bzl", _nodejs_binary = "nodejs_binary", _npm_package = "npm_package")
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(name, tsconfig = None, testonly = False, deps = [], module_name = None, **kwargs):
def ts_library(tsconfig = None, testonly = False, deps = [], module_name = None, **kwargs):
"""Default values for ts_library"""
deps = deps + ["@npm//tslib"]
if testonly:
@ -108,7 +108,6 @@ def ts_library(name, tsconfig = None, testonly = False, deps = [], module_name =
module_name = _default_module_name(testonly)
_ts_library(
name = name,
tsconfig = tsconfig,
testonly = testonly,
deps = deps,
@ -116,17 +115,6 @@ def ts_library(name, tsconfig = None, testonly = False, deps = [], module_name =
**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"]

View File

@ -6,15 +6,6 @@
* 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';

View File

@ -55,10 +55,7 @@ pkg_npm(
ts_library(
name = "test_lib",
testonly = True,
srcs = glob(
["test/*.ts"],
exclude = ["test/bootstrap.ts"],
),
srcs = glob(["test/*.ts"]),
tsconfig = "//tools:tsconfig-test",
deps = [
":lib",
@ -71,40 +68,18 @@ 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",
],
srcs = [":test_lib"],
bootstrap = ["angular/tools/ts-api-guardian/test/bootstrap.js"],
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