Greg Magolan 5f0d5e9ccf build: update to nodejs rules 0.34.0 and bazel 0.28.1 (#31824)
nodejs rules 0.34.0 now includes protractor_web_test_suite rule (via new @bazel/protractor rule) so we switch to that location for that rule in this PR so that /packages/bazel/src/protractor can be removed in a future PR

this PR also brings in node toolchain support which was released in nodejs rules 0.33.0. this is a prerequisite for RBE for mac & windows users

bazel schematics also updated with the same. @bazel/bazel 0.28.1 npm package includes transitive dep on hide-bazel-files so we're able to remove an explicit dep on that as well.

PR Close #31824
2019-07-26 15:01:25 -07:00

90 lines
2.2 KiB
Python

package(default_visibility = ["//visibility:public"])
load("//tools:defaults.bzl", "jasmine_node_test", "ng_module", "ts_library")
load("@npm_bazel_protractor//:index.bzl", "protractor_web_test_suite")
load("@npm_bazel_typescript//:index.bzl", "ts_devserver")
ng_module(
name = "core_examples",
srcs = glob(
["**/*.ts"],
exclude = [
"**/*_spec.ts",
"**/*_howto.ts",
],
),
# TODO: FW-1004 Type checking is currently not complete.
type_check = False,
deps = [
"//packages/animations",
"//packages/core",
"//packages/platform-browser",
"//packages/platform-browser-dynamic",
"//packages/platform-browser/animations",
"//packages/router",
"@npm//rxjs",
],
)
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,
srcs = glob(["**/e2e_test/*_spec.ts"]),
tsconfig = "//packages/examples:tsconfig-e2e.json",
deps = [
"//packages/examples/test-utils",
"@npm//@types/jasminewd2",
"@npm//protractor",
],
)
ts_devserver(
name = "devserver",
entry_module = "@angular/examples/core/main",
index_html = "//packages/examples:index.html",
port = 4200,
scripts = [
"@npm//:node_modules/tslib/tslib.js",
"//tools/rxjs:rxjs_umd_modules",
],
static_files = [
"@npm//:node_modules/zone.js/dist/zone.js",
"@npm//:node_modules/zone.js/dist/task-tracking.js",
],
deps = [":core_examples"],
)
protractor_web_test_suite(
name = "protractor_tests",
data = ["//packages/bazel/src/protractor/utils"],
on_prepare = ":start-server.js",
server = ":devserver",
deps = [
":core_e2e_tests_lib",
"@npm//protractor",
"@npm//selenium-webdriver",
],
)
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_spec.js"],
deps = [
":core_tests_lib",
"//tools/testing:node",
],
)