2019-11-13 12:08:38 -05:00
|
|
|
load("//tools:defaults.bzl", "karma_web_test_suite", "ts_library")
|
2020-01-14 09:31:13 -05:00
|
|
|
load("//tools/circular_dependency_test:index.bzl", "circular_dependency_test")
|
2020-05-05 02:25:34 -04:00
|
|
|
load("//tools:utils.bzl", "transpile_js_to_es5")
|
2020-01-14 09:31:13 -05:00
|
|
|
|
|
|
|
circular_dependency_test(
|
|
|
|
name = "circular_deps_test",
|
|
|
|
entry_point = "angular/packages/elements/index.js",
|
|
|
|
deps = ["//packages/elements"],
|
|
|
|
)
|
2018-02-28 12:45:11 -05:00
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "test_lib",
|
2018-10-16 02:24:22 -04:00
|
|
|
testonly = True,
|
2018-02-28 12:45:11 -05:00
|
|
|
srcs = glob(["**/*.ts"]),
|
|
|
|
deps = [
|
|
|
|
"//packages:types",
|
|
|
|
"//packages/compiler",
|
|
|
|
"//packages/core",
|
|
|
|
"//packages/core/testing",
|
|
|
|
"//packages/elements",
|
|
|
|
"//packages/platform-browser",
|
|
|
|
"//packages/platform-browser-dynamic",
|
|
|
|
"//packages/platform-browser-dynamic/testing",
|
|
|
|
"//packages/platform-browser/testing",
|
2019-02-20 12:54:42 -05:00
|
|
|
"@npm//rxjs",
|
2018-02-28 12:45:11 -05:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2020-05-05 02:25:34 -04:00
|
|
|
# This file is shipped as es2015 to npm. We have to transpile
|
|
|
|
# it to es5 in order to run the tests against older browsers.
|
|
|
|
transpile_js_to_es5(
|
|
|
|
name = "custom_elements_native_shim",
|
|
|
|
js_file = "@npm//:node_modules/@webcomponents/custom-elements/src/native-shim.js",
|
|
|
|
)
|
|
|
|
|
2018-02-28 12:45:11 -05:00
|
|
|
filegroup(
|
|
|
|
name = "elements_test_bootstrap_scripts",
|
2018-10-16 02:24:22 -04:00
|
|
|
testonly = True,
|
2018-02-28 12:45:11 -05:00
|
|
|
# do not sort
|
|
|
|
srcs = [
|
2020-03-08 11:52:17 -04:00
|
|
|
"@npm//:node_modules/core-js/client/core.js",
|
2020-05-05 02:25:34 -04:00
|
|
|
":custom_elements_native_shim",
|
2019-06-19 00:26:53 -04:00
|
|
|
"@npm//:node_modules/reflect-metadata/Reflect.js",
|
2019-10-05 23:06:53 -04:00
|
|
|
"//packages/zone.js/dist:zone.js",
|
|
|
|
"//packages/zone.js/dist:zone-testing.js",
|
2018-02-28 12:45:11 -05:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2019-11-13 12:08:38 -05:00
|
|
|
karma_web_test_suite(
|
2018-02-28 12:45:11 -05:00
|
|
|
name = "test",
|
|
|
|
bootstrap = [
|
|
|
|
":elements_test_bootstrap_scripts",
|
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
":test_lib",
|
|
|
|
],
|
|
|
|
)
|