build(bazel): fix bazel integration test after rules_typescript update (#25490)

PR Close #25490
This commit is contained in:
Greg Magolan
2018-08-21 01:37:09 -07:00
committed by Matias Niemelä
parent 22e7f7e99f
commit a59d4da304
8 changed files with 181 additions and 741 deletions

View File

@ -8,8 +8,12 @@ exports_files(["tsconfig.json"])
ng_module(
name = "src",
srcs = glob(["*.ts"]),
tsconfig = ":tsconfig.json",
deps = ["//src/hello-world"],
deps = [
"//src/hello-world",
"@angular//packages/common/http",
"@angular//packages/core",
"@angular//packages/platform-browser",
],
)
load("@build_bazel_rules_typescript//:defs.bzl", "ts_devserver")
@ -17,12 +21,13 @@ load("@build_bazel_rules_typescript//:defs.bzl", "ts_devserver")
ts_devserver(
name = "devserver",
additional_root_paths = [
"bazel_integration_test/node_modules/tslib",
"bazel_integration_test/node_modules/zone.js/dist",
],
entry_module = "bazel_integration_test/src/main",
scripts = ["//:angular_bundles"],
serving_path = "/bundle.min.js",
static_files = [
"//:node_modules/tslib/tslib.js",
"//:node_modules/zone.js/dist/zone.min.js",
"index.html",
],

View File

@ -16,10 +16,9 @@ ng_module(
exclude = ["*.spec.ts"],
),
assets = [":hello-world-styles"],
tsconfig = "//src:tsconfig.json",
# FIXME(alexeagle): the rxjs dep should come from Angular, but if we use the
# npm distro of angular there is no ts_library rule to propagate the dep.
deps = ["@rxjs"],
deps = [
"@angular//packages/core",
],
)
ng_package(
@ -32,20 +31,27 @@ ts_library(
name = "test_lib",
testonly = 1,
srcs = glob(["*.spec.ts"]),
tsconfig = "//src:tsconfig.json",
deps = [":hello-world"],
deps = [
":hello-world",
"@angular//packages/core",
"@angular//packages/core/testing",
"@angular//packages/platform-browser",
"@angular//packages/platform-browser-dynamic/testing",
],
)
ts_web_test_suite(
name = "test",
bootstrap = ["//:node_modules/zone.js/dist/zone-testing-bundle.js"],
srcs = ["//:node_modules/tslib/tslib.js"],
bootstrap = [
"//:node_modules/zone.js/dist/zone-testing-bundle.js",
"//:node_modules/reflect-metadata/Reflect.js",
],
browsers = [
"@io_bazel_rules_webtesting//browsers:chromium-local",
"@io_bazel_rules_webtesting//browsers:firefox-local",
],
deps = [
":test_lib",
"//:angular_bundles",
"//:angular_test_bundles",
],
)