build: run example unit tests with bazel (#28703)

With #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 #28703
This commit is contained in:
Paul Gschwendtner 2019-02-12 20:10:43 +01:00 committed by Igor Minar
parent 05c25ccca7
commit bcdd4b5729
1 changed files with 23 additions and 1 deletions

View File

@ -1,7 +1,7 @@
package(default_visibility = ["//visibility:public"])
load("//packages/bazel:index.bzl", "protractor_web_test_suite")
load("//tools:defaults.bzl", "ng_module", "ts_library")
load("//tools:defaults.bzl", "jasmine_node_test", "ng_module", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_devserver")
ng_module(
@ -26,6 +26,19 @@ ng_module(
],
)
ts_library(
name = "core_tests_lib",
testonly = True,
srcs = glob(
["**/*_spec.ts"],
exclude = ["**/e2e_test/*"],
),
deps = [
"//packages/core",
"//packages/core/testing",
],
)
ts_library(
name = "core_e2e_tests_lib",
testonly = True,
@ -65,3 +78,12 @@ protractor_web_test_suite(
"@ngdeps//selenium-webdriver",
],
)
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":core_tests_lib",
"//tools/testing:node",
],
)