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

351 lines
7.9 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",
"common/promise-disable-wrap-uncaught-promise-rejection.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",
"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 = "node_entry_point",
testonly = True,
srcs = ["node_entry_point.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 = "node_entry_point_no_patch_clock",
testonly = True,
srcs = ["node_entry_point_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",
],
deps = [
":common_spec_env",
"//packages/zone.js/lib",
"@npm//bluebird",
],
)
ts_library(
name = "node_bluebird_entry_point",
testonly = True,
srcs = ["node_bluebird_entry_point.ts"],
deps = [
":common_spec_env",
"//packages/zone.js/lib",
"@npm//bluebird",
],
)
ts_library(
name = "node_error_disable_policy_entry_point",
testonly = True,
srcs = ["node_error_disable_policy_entry_point.ts"],
deps = [
":common_spec_env",
":common_spec_util",
":error_spec_srcs",
":node_error_entry_point",
"//packages/zone.js/lib",
],
)
ts_library(
name = "node_error_entry_point",
testonly = True,
srcs = ["node_error_entry_point.ts"],
deps = [
":common_spec_env",
":common_spec_util",
":error_spec_srcs",
"//packages/zone.js/lib",
],
)
ts_library(
name = "node_error_lazy_policy_entry_point",
testonly = True,
srcs = ["node_error_lazy_policy_entry_point.ts"],
deps = [
":common_spec_env",
":common_spec_util",
":error_spec_srcs",
":node_error_entry_point",
"//packages/zone.js/lib",
],
)
jasmine_node_test(
name = "test_node",
bootstrap = [":node_entry_point_es5"],
deps = [
":test_node_lib",
],
)
jasmine_node_test(
name = "test_node_no_jasmine_clock",
bootstrap = [":node_entry_point_no_patch_clock_es5"],
deps = [
":test_node_lib",
],
)
jasmine_node_test(
name = "test_node_bluebird",
bootstrap = [":node_bluebird_entry_point_es5"],
deps = [
":bluebird_spec",
],
)
jasmine_node_test(
name = "test_node_error_disable_policy",
bootstrap = [":node_error_disable_policy_entry_point_es5"],
)
jasmine_node_test(
name = "test_node_error_lazy_policy",
bootstrap = [":node_error_lazy_policy_entry_point_es5"],
)
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",
"common/promise-disable-wrap-uncaught-promise-rejection.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/bundles:zone-testing-bundle.umd.js"],
"browser_green_test": [
"//packages/zone.js/fesm2015:zone.js",
"//packages/zone.js/fesm2015:zone-testing.js",
],
"browser_legacy_test": [
"//packages/zone.js/bundles:zone-legacy.umd.js",
"//packages/zone.js/bundles:zone.umd.js",
"//packages/zone.js/bundles:zone-testing.umd.js",
],
}
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/bundles:zone-testing-bundle.umd.js",
"//packages/zone.js/bundles:webapis-shadydom.umd.js",
]},
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",
],
)
karma_test(
name = "browser_disable_wrap_uncaught_promise_rejection",
bootstraps = {"browser_disable_wrap_uncaught_promise_rejection": [
"//packages/zone.js/bundles:zone-testing-bundle.umd.js",
]},
ci = False,
env_deps = [
"//packages/zone.js/lib",
],
env_entry_point = ":browser_disable_wrap_uncaught_promise_rejection_setup.ts",
env_srcs = ["browser_disable_wrap_uncaught_promise_rejection_setup.ts"],
test_deps = [
"//packages/zone.js/lib",
],
test_entry_point = ":browser_disable_wrap_uncaught_promise_rejection_entry_point.ts",
test_srcs = [
"common/promise-disable-wrap-uncaught-promise-rejection.spec.ts",
"browser_disable_wrap_uncaught_promise_rejection_entry_point.ts",
],
)