2019-05-31 11:56:07 -04:00
|
|
|
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
|
2019-07-21 06:44:13 -04:00
|
|
|
load("//packages/zone.js/test:karma_test.bzl", "karma_test")
|
2019-05-31 11:56:07 -04:00
|
|
|
|
2019-06-20 16:31:05 -04:00
|
|
|
package(default_visibility = ["//:__pkg__"])
|
|
|
|
|
2019-05-31 11:56:07 -04:00
|
|
|
exports_files([
|
|
|
|
"assets/sample.json",
|
|
|
|
"assets/worker.js",
|
|
|
|
"assets/import.html",
|
|
|
|
])
|
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "common_spec_env",
|
|
|
|
testonly = True,
|
2019-06-20 14:53:45 -04:00
|
|
|
srcs = [
|
|
|
|
"test-env-setup-jasmine.ts",
|
2019-05-31 11:56:07 -04:00
|
|
|
"test_fake_polyfill.ts",
|
|
|
|
"wtf_mock.ts",
|
2019-06-20 14:53:45 -04:00
|
|
|
],
|
2019-05-31 11:56:07 -04:00
|
|
|
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,
|
2019-06-20 14:53:45 -04:00
|
|
|
srcs = ["test-util.ts"],
|
2019-05-31 11:56:07 -04:00
|
|
|
deps = [
|
|
|
|
"//packages/zone.js/lib",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "error_spec_srcs",
|
|
|
|
testonly = True,
|
2019-06-20 14:53:45 -04:00
|
|
|
srcs = [
|
2019-05-31 11:56:07 -04:00
|
|
|
"common/Error.spec.ts",
|
2019-06-20 14:53:45 -04:00
|
|
|
],
|
2019-05-31 11:56:07 -04:00
|
|
|
deps = [
|
|
|
|
":common_spec_util",
|
|
|
|
"//packages/zone.js/lib",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "test_node_lib",
|
|
|
|
testonly = True,
|
2019-06-20 14:53:45 -04:00
|
|
|
srcs = glob(["node/*.ts"]) + [
|
|
|
|
"node-env-setup.ts",
|
|
|
|
"test-env-setup-jasmine-no-patch-clock.ts",
|
|
|
|
],
|
2019-05-31 11:56:07 -04:00
|
|
|
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",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2019-12-28 21:14:36 -05:00
|
|
|
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",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2019-05-31 11:56:07 -04:00
|
|
|
ts_library(
|
|
|
|
name = "bluebird_spec",
|
|
|
|
testonly = True,
|
2019-06-20 14:53:45 -04:00
|
|
|
srcs = [
|
2019-05-31 11:56:07 -04:00
|
|
|
"extra/bluebird.spec.ts",
|
2019-06-20 14:53:45 -04:00
|
|
|
],
|
2019-05-31 11:56:07 -04:00
|
|
|
deps = [
|
|
|
|
":common_spec_env",
|
|
|
|
"//packages/zone.js/lib",
|
|
|
|
"@npm//bluebird",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
ts_library(
|
2019-12-28 21:14:36 -05:00
|
|
|
name = "node_bluebird_entry_point",
|
2019-05-31 11:56:07 -04:00
|
|
|
testonly = True,
|
2019-12-28 21:14:36 -05:00
|
|
|
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",
|
2019-06-20 14:53:45 -04:00
|
|
|
],
|
2019-12-28 21:14:36 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "node_error_lazy_policy_entry_point",
|
|
|
|
testonly = True,
|
|
|
|
srcs = ["node_error_lazy_policy_entry_point.ts"],
|
2019-05-31 11:56:07 -04:00
|
|
|
deps = [
|
|
|
|
":common_spec_env",
|
|
|
|
":common_spec_util",
|
|
|
|
":error_spec_srcs",
|
2019-12-28 21:14:36 -05:00
|
|
|
":node_error_entry_point",
|
2019-05-31 11:56:07 -04:00
|
|
|
"//packages/zone.js/lib",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
jasmine_node_test(
|
|
|
|
name = "test_node",
|
2020-01-10 16:39:52 -05:00
|
|
|
templated_args = ["--node_options=--require=$(rlocation $(location :node_entry_point_es5))"],
|
2019-05-31 11:56:07 -04:00
|
|
|
deps = [
|
2020-01-10 16:39:52 -05:00
|
|
|
":node_entry_point_es5",
|
2019-05-31 11:56:07 -04:00
|
|
|
":test_node_lib",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
jasmine_node_test(
|
|
|
|
name = "test_node_no_jasmine_clock",
|
2020-01-10 16:39:52 -05:00
|
|
|
templated_args = ["--node_options=--require=$(rlocation $(location :node_entry_point_no_patch_clock_es5))"],
|
2019-05-31 11:56:07 -04:00
|
|
|
deps = [
|
2020-01-10 16:39:52 -05:00
|
|
|
":node_entry_point_no_patch_clock_es5",
|
2019-05-31 11:56:07 -04:00
|
|
|
":test_node_lib",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
jasmine_node_test(
|
|
|
|
name = "test_node_bluebird",
|
2020-01-10 16:39:52 -05:00
|
|
|
templated_args = ["--node_options=--require=$(rlocation $(location :node_bluebird_entry_point_es5))"],
|
2019-05-31 11:56:07 -04:00
|
|
|
deps = [
|
|
|
|
":bluebird_spec",
|
2020-01-10 16:39:52 -05:00
|
|
|
":node_bluebird_entry_point_es5",
|
2019-05-31 11:56:07 -04:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
jasmine_node_test(
|
|
|
|
name = "test_node_error_disable_policy",
|
2020-01-10 16:39:52 -05:00
|
|
|
templated_args = ["--node_options=--require=$(rlocation $(location :node_error_disable_policy_entry_point_es5))"],
|
2020-01-10 16:39:37 -05:00
|
|
|
deps = [
|
|
|
|
":node_error_disable_policy_entry_point",
|
2020-01-10 16:39:52 -05:00
|
|
|
":node_error_disable_policy_entry_point_es5",
|
2020-01-10 16:39:37 -05:00
|
|
|
],
|
2019-05-31 11:56:07 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
jasmine_node_test(
|
|
|
|
name = "test_node_error_lazy_policy",
|
2020-01-10 16:39:52 -05:00
|
|
|
templated_args = ["--node_options=--require=$(rlocation $(location :node_error_lazy_policy_entry_point_es5))"],
|
2020-01-10 16:39:37 -05:00
|
|
|
deps = [
|
|
|
|
":node_error_lazy_policy_entry_point",
|
2020-01-10 16:39:52 -05:00
|
|
|
":node_error_lazy_policy_entry_point_es5",
|
2020-01-10 16:39:37 -05:00
|
|
|
],
|
2019-05-31 11:56:07 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "npm_package_spec_lib",
|
|
|
|
testonly = True,
|
|
|
|
srcs = ["npm_package/npm_package.spec.ts"],
|
|
|
|
deps = [
|
2019-06-22 00:52:00 -04:00
|
|
|
"@npm//@types/shelljs",
|
2019-05-31 11:56:07 -04:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
jasmine_node_test(
|
|
|
|
name = "test_npm_package",
|
|
|
|
srcs = [":npm_package_spec_lib"],
|
|
|
|
data = [
|
|
|
|
"//packages/zone.js:npm_package",
|
|
|
|
"@npm//shelljs",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2019-07-21 06:44:13 -04:00
|
|
|
env_srcs = [
|
|
|
|
"browser-env-setup.ts",
|
|
|
|
"browser_symbol_setup.ts",
|
|
|
|
]
|
2019-05-31 11:56:07 -04:00
|
|
|
|
2019-07-21 06:44:13 -04:00
|
|
|
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",
|
|
|
|
]
|
2019-05-31 11:56:07 -04:00
|
|
|
|
2019-07-21 06:44:13 -04:00
|
|
|
env_entry_point = ":browser-env-setup.ts"
|
2019-05-31 11:56:07 -04:00
|
|
|
|
2019-07-21 06:44:13 -04:00
|
|
|
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",
|
|
|
|
]
|
2019-05-31 11:56:07 -04:00
|
|
|
|
2019-07-21 06:44:13 -04:00
|
|
|
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",
|
2019-05-31 11:56:07 -04:00
|
|
|
]
|
|
|
|
|
2019-07-21 06:44:13 -04:00
|
|
|
test_entry_point = ":browser_entry_point.ts"
|
2019-05-31 11:56:07 -04:00
|
|
|
|
2019-07-21 06:44:13 -04:00
|
|
|
karma_tests = {
|
|
|
|
"browser_test": ["//packages/zone.js/dist:zone-testing-bundle-dist-dev-test"],
|
|
|
|
"browser_green_test": [
|
2019-05-31 11:56:07 -04:00
|
|
|
"//packages/zone.js/dist:zone-evergreen-dist-dev-test",
|
2019-08-05 20:54:54 -04:00
|
|
|
"//packages/zone.js/dist:zone-testing-dist-dev-test",
|
|
|
|
],
|
|
|
|
"browser_legacy_test": [
|
|
|
|
"//packages/zone.js/dist:zone-legacy-dist-dev-test",
|
|
|
|
"//packages/zone.js/dist:zone-evergreen-dist-dev-test",
|
2019-05-31 11:56:07 -04:00
|
|
|
"//packages/zone.js/dist:zone-testing-dist-dev-test",
|
|
|
|
],
|
2019-07-21 06:44:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
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,
|
2019-05-31 11:56:07 -04:00
|
|
|
)
|
|
|
|
|
2019-07-21 06:44:13 -04:00
|
|
|
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",
|
2019-05-31 11:56:07 -04:00
|
|
|
],
|
2019-07-21 06:44:13 -04:00
|
|
|
env_entry_point = ":browser_shadydom_setup.ts",
|
|
|
|
env_srcs = ["browser_shadydom_setup.ts"],
|
|
|
|
test_deps = [
|
|
|
|
"//packages/zone.js/lib",
|
2019-05-31 11:56:07 -04:00
|
|
|
],
|
2019-07-21 06:44:13 -04:00
|
|
|
test_entry_point = ":browser_shadydom_entry_point.ts",
|
|
|
|
test_srcs = [
|
|
|
|
"browser/shadydom.spec.ts",
|
|
|
|
"browser_shadydom_entry_point.ts",
|
2019-05-31 11:56:07 -04:00
|
|
|
],
|
|
|
|
)
|