build: fix and re-enable elements tests on saucelabs (#36929)

The `elements` tests were disabled on Saucelabs, because they were failing on IE10. The problem was that we were loading an es2015 file from npm directly, causing a syntax error. These changes transpile the file to es5.

PR Close #36929
This commit is contained in:
crisbeto 2020-05-05 08:25:34 +02:00 committed by Alex Rickabaugh
parent b4df19c029
commit b95a336f12
1 changed files with 9 additions and 12 deletions

View File

@ -1,5 +1,6 @@
load("//tools:defaults.bzl", "karma_web_test_suite", "ts_library") load("//tools:defaults.bzl", "karma_web_test_suite", "ts_library")
load("//tools/circular_dependency_test:index.bzl", "circular_dependency_test") load("//tools/circular_dependency_test:index.bzl", "circular_dependency_test")
load("//tools:utils.bzl", "transpile_js_to_es5")
circular_dependency_test( circular_dependency_test(
name = "circular_deps_test", name = "circular_deps_test",
@ -25,13 +26,20 @@ ts_library(
], ],
) )
# 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",
)
filegroup( filegroup(
name = "elements_test_bootstrap_scripts", name = "elements_test_bootstrap_scripts",
testonly = True, testonly = True,
# do not sort # do not sort
srcs = [ srcs = [
"@npm//:node_modules/core-js/client/core.js", "@npm//:node_modules/core-js/client/core.js",
"@npm//:node_modules/@webcomponents/custom-elements/src/native-shim.js", ":custom_elements_native_shim",
"@npm//:node_modules/reflect-metadata/Reflect.js", "@npm//:node_modules/reflect-metadata/Reflect.js",
"//packages/zone.js/dist:zone.js", "//packages/zone.js/dist:zone.js",
"//packages/zone.js/dist:zone-testing.js", "//packages/zone.js/dist:zone-testing.js",
@ -43,17 +51,6 @@ karma_web_test_suite(
bootstrap = [ bootstrap = [
":elements_test_bootstrap_scripts", ":elements_test_bootstrap_scripts",
], ],
tags = [
# disabled on 2020-04-14 due to failure on saucelabs monitor job
# https://app.circleci.com/pipelines/github/angular/angular/13320/workflows/9ca3527a-d448-4a64-880a-fb4de9d1fece/jobs/680645
# ```
# IE 10.0.0 (Windows 8.0.0) ERROR
# An error was thrown in afterAll
# Syntax error
# ```
"fixme-saucelabs-ve",
"fixme-saucelabs-ivy",
],
deps = [ deps = [
":test_lib", ":test_lib",
], ],