angular/tools/testing/BUILD.bazel
Joey Perrott 22381bfd2d build: update tools directory to use rules_js for building (#61656)
Use ts_project for building the tools directory targets

PR Close #61656
2025-05-26 09:01:13 +00:00

111 lines
3.3 KiB
Text

load("//tools:defaults.bzl", "jasmine_node_test")
load("//tools:defaults2.bzl", "ts_project")
package(default_visibility = ["//visibility:public"])
ts_project(
name = "zone_base_setup_lib",
testonly = 1,
srcs = ["zone_base_setup.mts"],
interop_deps = [
"//packages/zone.js/lib",
"@npm//reflect-metadata",
],
)
ts_project(
name = "browser",
testonly = 1,
srcs = ["browser_tests.init.mts"],
interop_deps = [
":zone_base_setup_lib",
"//packages/compiler",
"//packages/core/testing",
"//packages/platform-browser/animations",
"//packages/platform-browser/testing",
"//packages/zone.js/lib",
],
)
ts_project(
name = "browser_zoneless",
testonly = 1,
srcs = ["browser_zoneless_tests.init.mts"],
interop_deps = [
"//packages/compiler",
"//packages/core",
"//packages/core/testing",
"//packages/platform-browser/animations",
"//packages/platform-browser/testing",
"@npm//reflect-metadata",
],
)
ts_project(
name = "node_zoneless",
testonly = 1,
srcs = ["node_zoneless_tests.init.mts"],
interop_deps = [
"//packages/compiler",
"//packages/core",
"//packages/core/testing",
"//packages/platform-server",
"//packages/platform-server:bundled_domino_lib",
"//packages/platform-server/testing",
"@npm//reflect-metadata",
],
)
ts_project(
name = "node",
testonly = 1,
srcs = ["node_tests.init.mts"],
interop_deps = [
":zone_base_setup_lib",
"//packages/compiler",
"//packages/core/testing",
"//packages/platform-server",
"//packages/platform-server:bundled_domino_lib",
"//packages/platform-server/testing",
"//packages/zone.js/lib",
"@npm//reflect-metadata",
],
)
ts_project(
name = "node_no_angular",
testonly = 1,
srcs = ["node_no_angular_tests.init.mts"],
interop_deps = [
"//packages:types",
],
)
# A test to verify that jasmine_node_test targets fail as expected.
# This is to catch any future regressions to jasmine_node_test where
# tests pass silently without executing.
# See https://github.com/bazelbuild/rules_nodejs/pull/1540 for an example
# of a potential regression.
jasmine_node_test(
name = "fail_test",
srcs = ["fail.spec.mjs"],
# While we force the termination of the process with an exitCode of 55 in fail.spec.js. Jasmine force it to 4.
# see: https://github.com/jasmine/jasmine-npm/blob/eea8b26efe29176ecbb26ce3f1c4990f8bede685/lib/jasmine.js#L213
expected_exit_code = 4,
)
# A test to verify that jasmine_node_test targets fail as expected
# when there is a bootstrap script set.
# This is to catch any future regressions to jasmine_node_test where
# tests pass silently without executing.
# See https://github.com/bazelbuild/rules_nodejs/pull/1540 for an example
# of a potential regression.
jasmine_node_test(
name = "fail_bootstrap_test",
srcs = ["fail.spec.mjs"],
bootstrap = ["//tools/testing:node"],
data = ["//packages:package_json"],
# While we force the termination of the process with an exitCode of 55 in fail.spec.js. Jasmine force it to 4.
# see: https://github.com/jasmine/jasmine-npm/blob/eea8b26efe29176ecbb26ce3f1c4990f8bede685/lib/jasmine.js#L213
expected_exit_code = 4,
)