refactor: update packages/router tests to be compatible with ESM (#48538)

The ESM js files need to be referenced, and the router tests rely
on `async/await` with change detection- so a special rule is required
that downlevels `async/await` to generators (similar to the Angular CLI)

PR Close #48538
This commit is contained in:
Paul Gschwendtner
2022-12-13 20:36:24 +00:00
parent 9b0a7e2d7d
commit cca335dc40
2 changed files with 7 additions and 5 deletions
+6 -4
View File
@@ -1,15 +1,15 @@
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite", "ts_library")
load("//tools:defaults.bzl", "karma_web_test_suite", "ts_library", "zone_compatible_jasmine_node_test")
load("//tools/circular_dependency_test:index.bzl", "circular_dependency_test")
circular_dependency_test(
name = "circular_deps_test",
entry_point = "angular/packages/router/index.js",
entry_point = "angular/packages/router/index.mjs",
deps = ["//packages/router"],
)
circular_dependency_test(
name = "testing_circular_deps_test",
entry_point = "angular/packages/router/testing/index.js",
entry_point = "angular/packages/router/testing/index.mjs",
deps = ["//packages/router/testing"],
)
@@ -34,7 +34,9 @@ ts_library(
],
)
jasmine_node_test(
# Tests rely on `async/await` for change detection.
# This syntax needs to be downleveled until ZoneJS supports it.
zone_compatible_jasmine_node_test(
name = "test",
bootstrap = ["//tools/testing:node"],
deps = [
+1 -1
View File
@@ -3,7 +3,7 @@ load("//tools/circular_dependency_test:index.bzl", "circular_dependency_test")
circular_dependency_test(
name = "circular_deps_test",
entry_point = "angular/packages/router/upgrade/index.js",
entry_point = "angular/packages/router/upgrade/index.mjs",
deps = ["//packages/router/upgrade"],
)