Skip to content

Commit bcdd4b5

Browse files
devversionIgorMinar
authored andcommitted
build: run example unit tests with bazel (angular#28703)
With angular#28402 we updated the `examples` package to be built and tested with Bazel. This PR was only intended for the e2e integration tests, and there still seem to be a few unit tests that need to be migrated to Bazel until we can remove the legacy local unit tests job. PR Close angular#28703
1 parent 05c25cc commit bcdd4b5

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

packages/examples/core/BUILD.bazel

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package(default_visibility = ["//visibility:public"])
22

33
load("//packages/bazel:index.bzl", "protractor_web_test_suite")
4-
load("//tools:defaults.bzl", "ng_module", "ts_library")
4+
load("//tools:defaults.bzl", "jasmine_node_test", "ng_module", "ts_library")
55
load("@build_bazel_rules_typescript//:defs.bzl", "ts_devserver")
66

77
ng_module(
@@ -26,6 +26,19 @@ ng_module(
2626
],
2727
)
2828

29+
ts_library(
30+
name = "core_tests_lib",
31+
testonly = True,
32+
srcs = glob(
33+
["**/*_spec.ts"],
34+
exclude = ["**/e2e_test/*"],
35+
),
36+
deps = [
37+
"//packages/core",
38+
"//packages/core/testing",
39+
],
40+
)
41+
2942
ts_library(
3043
name = "core_e2e_tests_lib",
3144
testonly = True,
@@ -65,3 +78,12 @@ protractor_web_test_suite(
6578
"@ngdeps//selenium-webdriver",
6679
],
6780
)
81+
82+
jasmine_node_test(
83+
name = "test",
84+
bootstrap = ["angular/tools/testing/init_node_spec.js"],
85+
deps = [
86+
":core_tests_lib",
87+
"//tools/testing:node",
88+
],
89+
)

0 commit comments

Comments
 (0)