angular-docs-cn/packages/zone.js/test/BUILD.bazel

273 lines
5.7 KiB
Python

load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
load("//packages/zone.js/test:karma_test.bzl", "karma_test")
package(default_visibility = ["//:__pkg__"])
exports_files([
"assets/sample.json",
"assets/worker.js",
"assets/import.html",
])
ts_library(
name = "common_spec_env",
testonly = True,
srcs = [
"test-env-setup-jasmine.ts",
"test_fake_polyfill.ts",
"wtf_mock.ts",
],
deps = [
"//packages/zone.js/lib",
],
)
ts_library(
name = "common_spec_srcs",
testonly = True,
srcs = glob(
[
"common/*.ts",
"zone-spec/*.ts",
"rxjs/*.ts",
],
exclude = [
"common/Error.spec.ts",
],
),
deps = [
":common_spec_util",
"//packages/zone.js/lib",
"@npm//rxjs",
],
)
ts_library(
name = "common_spec_util",
testonly = True,
srcs = ["test-util.ts"],
deps = [
"//packages/zone.js/lib",
],
)
ts_library(
name = "error_spec_srcs",
testonly = True,
srcs = [
"common/Error.spec.ts",
],
deps = [
":common_spec_util",
"//packages/zone.js/lib",
],
)
ts_library(
name = "test_node_lib",
testonly = True,
srcs = glob(["node/*.ts"]) + [
"node-env-setup.ts",
"node_entry_point.ts",
"node_entry_point_no_patch_clock.ts",
"test-env-setup-jasmine-no-patch-clock.ts",
],
deps = [
":common_spec_env",
":common_spec_srcs",
":common_spec_util",
"//packages/zone.js/lib",
"@npm//@types/shelljs",
"@npm//@types/systemjs",
"@npm//rxjs",
"@npm//shelljs",
"@npm//systemjs",
],
)
ts_library(
name = "bluebird_spec",
testonly = True,
srcs = [
"extra/bluebird.spec.ts",
"node_bluebird_entry_point.ts",
],
deps = [
":common_spec_env",
"//packages/zone.js/lib",
"@npm//bluebird",
],
)
ts_library(
name = "error_spec",
testonly = True,
srcs = [
"node_error_disable_policy_entry_point.ts",
"node_error_entry_point.ts",
"node_error_lazy_policy_entry_point.ts",
],
deps = [
":common_spec_env",
":common_spec_util",
":error_spec_srcs",
"//packages/zone.js/lib",
],
)
jasmine_node_test(
name = "test_node",
bootstrap = [
"angular/packages/zone.js/test/node_entry_point.js",
],
deps = [
":test_node_lib",
],
)
jasmine_node_test(
name = "test_node_no_jasmine_clock",
bootstrap = [
"angular/packages/zone.js/test/node_entry_point_no_patch_clock.js",
],
deps = [
":test_node_lib",
],
)
jasmine_node_test(
name = "test_node_bluebird",
bootstrap = [
"angular/packages/zone.js/test/node_bluebird_entry_point.js",
],
deps = [
":bluebird_spec",
],
)
jasmine_node_test(
name = "test_node_error_disable_policy",
bootstrap = [
"angular/packages/zone.js/test/node_error_disable_policy_entry_point.js",
],
deps = [
":error_spec",
],
)
jasmine_node_test(
name = "test_node_error_lazy_policy",
bootstrap = [
"angular/packages/zone.js/test/node_error_lazy_policy_entry_point.js",
],
deps = [
":error_spec",
],
)
ts_library(
name = "npm_package_spec_lib",
testonly = True,
srcs = ["npm_package/npm_package.spec.ts"],
deps = [
"@npm//@types/shelljs",
],
)
jasmine_node_test(
name = "test_npm_package",
srcs = [":npm_package_spec_lib"],
data = [
"//packages/zone.js:npm_package",
"@npm//shelljs",
],
)
env_srcs = [
"browser-env-setup.ts",
"browser_symbol_setup.ts",
]
env_deps = [
":common_spec_env",
":common_spec_srcs",
":common_spec_util",
":error_spec_srcs",
"//packages/zone.js/lib",
"@npm//@types/shelljs",
"@npm//@types/systemjs",
"@npm//rxjs",
"@npm//shelljs",
"@npm//systemjs",
]
env_entry_point = ":browser-env-setup.ts"
test_srcs = glob(
["browser/*.ts"],
exclude = ["browser/shadydom.spec.ts"],
) + [
"extra/cordova.spec.ts",
"mocha-patch.spec.ts",
"jasmine-patch.spec.ts",
"common_tests.ts",
"browser_entry_point.ts",
]
test_deps = [
":common_spec_env",
":common_spec_srcs",
":common_spec_util",
":error_spec_srcs",
"//packages/zone.js/lib",
"@npm//@types/shelljs",
"@npm//@types/systemjs",
"@npm//rxjs",
"@npm//shelljs",
"@npm//systemjs",
]
test_entry_point = ":browser_entry_point.ts"
karma_tests = {
"browser_test": ["//packages/zone.js/dist:zone-testing-bundle-dist-dev-test"],
"browser_green_test": [
"//packages/zone.js/dist:zone-evergreen-dist-dev-test",
"//packages/zone.js/dist:zone-testing-dist-dev-test",
],
}
karma_test(
name = "browser_test",
bootstraps = karma_tests,
ci = True,
env_deps = env_deps,
env_entry_point = env_entry_point,
env_srcs = env_srcs,
test_deps = test_deps,
test_entry_point = test_entry_point,
test_srcs = test_srcs,
)
karma_test(
name = "browser_shadydom",
bootstraps = {"browser_shadydom": [
"//packages/zone.js/dist:zone-testing-bundle-dist-dev-test",
"//packages/zone.js/dist:webapis-shadydom-dist-dev-test",
]},
ci = False,
env_deps = [
"//packages/zone.js/lib",
],
env_entry_point = ":browser_shadydom_setup.ts",
env_srcs = ["browser_shadydom_setup.ts"],
test_deps = [
"//packages/zone.js/lib",
],
test_entry_point = ":browser_shadydom_entry_point.ts",
test_srcs = [
"browser/shadydom.spec.ts",
"browser_shadydom_entry_point.ts",
],
)