refactor: handle breaking changes in rules_nodejs 1.0.0 (#34589)
The major one that affects the angular repo is the removal of the bootstrap attribute in nodejs_binary, nodejs_test and jasmine_node_test in favor of using templated_args --node_options=--require=/path/to/script. The side-effect of this is that the bootstrap script does not get the require.resolve patches with explicitly loading the targets _loader.js file. PR Close #34589
This commit is contained in:
@ -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",
|
||||
],
|
||||
|
@ -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",
|
||||
],
|
||||
|
@ -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",
|
||||
],
|
||||
|
@ -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",
|
||||
],
|
||||
)
|
||||
|
@ -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.
|
||||
|
@ -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",
|
||||
],
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user