8000 refactor: update platform-browser tests to run as ESM (#48521) · angular/angular@653e122 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit 653e122

Browse files
committed
refactor: update platform-browser tests to run as ESM (#48521)
`platform-browser` tests now run in ESM and with `.mjs` output, so the build targets and tests need to be updated. Here we change the `zone_event_unpatched` script to include the `.init` suffix that will be picked up by `spec_bundle`. Also some circular dependency tests are updated to refer to the `.mjs` files. PR Close #48521
1 parent decae5b commit 653e122

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

karma-js.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = function(config) {
4040

4141
// ZoneJS configuration needed for some event manager tests. This config could
4242
// affect all legacy tests but in reality is scoped to certain special tests.
43-
'packages/platform-browser/test/dom/events/zone_event_unpatched_init.js',
43+
'packages/platform-browser/test/dom/events/zone_event_unpatched.init.js',
4444

4545
// Dependencies built by Bazel. See `config.yml` for steps running before
4646
// the legacy Saucelabs tests run.
@@ -56,7 +56,7 @@ module.exports = function(config) {
5656
{
5757
pattern: 'node_modules/@webcomponents/custom-elements/**/*.js',
5858
included: false,
59-
watched: false
59+
watched: false,
6060
},
6161

6262
'node_modules/reflect-metadata/Reflect.js',

packages/platform-browser/animations/test/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ load("//tools/circular_dependency_test:index.bzl", "circular_dependency_test")
33

44
circular_dependency_test(
55
name = "circular_deps_test",
6-
entry_point = "angular/packages/platform-browser/animations/index.js",
6+
entry_point = "angular/packages/platform-browser/animations/index.mjs",
77
deps = ["//packages/platform-browser/animations"],
88
)
99

packages/platform-browser/test/BUILD.bazel

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
12
load("//tools:defaults.bzl", "jasmine_node_test", "karma_web_test_suite", "ts_library")
23
load("//tools/circular_dependency_test:index.bzl", "circular_dependency_test")
34

@@ -8,13 +9,13 @@ exports_files([
89

910
circular_dependency_test(
1011
name = "circular_deps_test",
11-
entry_point = "angular/packages/platform-browser/index.js",
12+
entry_point = "angular/packages/platform-browser/index.mjs",
1213
deps = ["//packages/platform-browser"],
1314
)
1415

1516
circular_dependency_test(
1617
name = "testing_circular_deps_test",
17-
entry_point = "angular/packages/platform-browser/testing/index.js",
18+
entry_point = "angular/packages/platform-browser/testing/index.mjs",
1819
deps = ["//packages/platform-browser/testing"],
1920
)
2021

@@ -40,6 +41,11 @@ ts_library(
4041
],
4142
)
4243

44+
js_library(
45+
name = "zone_event_unpatched_init_lib",
46+
srcs = ["dom/events/zone_event_unpatched.init.js"],
47+
)
48+
4349
jasmine_node_test(
4450
name = "test",
4551
bootstrap = ["//tools/testing:node"],
@@ -51,7 +57,7 @@ jasmine_node_test(
5157
karma_web_test_suite(
5258
name = "test_web",
5359
bootstrap = [
54-
"dom/events/zone_event_unpatched_init.js",
60+
":zone_event_unpatched_init_lib",
5561
],
5662
static_files = [
5763
":static_assets/test.html",

0 commit comments

Comments
 (0)
0