From b95a336f12baa41f114774963146f112d4d229cd Mon Sep 17 00:00:00 2001 From: crisbeto Date: Tue, 5 May 2020 08:25:34 +0200 Subject: [PATCH] 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 --- packages/elements/test/BUILD.bazel | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/packages/elements/test/BUILD.bazel b/packages/elements/test/BUILD.bazel index 29565ccc70..334bcc49e7 100644 --- a/packages/elements/test/BUILD.bazel +++ b/packages/elements/test/BUILD.bazel @@ -1,5 +1,6 @@ load("//tools:defaults.bzl", "karma_web_test_suite", "ts_library") load("//tools/circular_dependency_test:index.bzl", "circular_dependency_test") +load("//tools:utils.bzl", "transpile_js_to_es5") circular_dependency_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( name = "elements_test_bootstrap_scripts", testonly = True, # do not sort srcs = [ "@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", "//packages/zone.js/dist:zone.js", "//packages/zone.js/dist:zone-testing.js", @@ -43,17 +51,6 @@ karma_web_test_suite( bootstrap = [ ":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 = [ ":test_lib", ],