Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 72f1463

Browse filesBrowse files
joyeecheungaduh95
authored andcommitted
test: split test-esm-loader-hooks
Previously whenever one of the test case fails in the CI, it barely logged anything useful in the CI and it was difficult to nail down the specific failing case with a local reproduction, especially when the test fixutre is inline JavaScript. This patch: - Puts all the inline JavaScript in on-disk fixtures so that they can be re-run easily. - Split the tests into individual files so that it's easier to nail down the failure - Use spawnSyncAndAssert which logs useful information when the child process does not behave as expected. - Rename the tests as module-hooks/test-async-loader-hooks-* because they belong to the module hooks test suite and are not esm-specific. PR-URL: #61374 Refs: https://github.com/nodejs/reliability/blob/main/reports/2026-01-13.md Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 5ab8057 commit 72f1463
Copy full SHA for 72f1463

81 files changed

+1,227-860Lines changed: 1227 additions & 860 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/es-module/test-esm-loader-hooks.mjs‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-loader-hooks.mjs
-860Lines changed: 0 additions & 860 deletions
This file was deleted.
Collapse file
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function load(a, b, c) {
2+
return new Promise(d => setTimeout(() => d(c(a, b)), 99));
3+
}
Collapse file
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export function load(a, b, next) {
2+
if (a === 'data:exit') process.exit(42);
3+
return next(a, b);
4+
}
Collapse file
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export function resolve(a, b, next) {
2+
if (a === 'exit:') process.exit(42);
3+
return next(a, b);
4+
}
Collapse file
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
process.exit(42);
Collapse file
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export function globalPreload() {}
2+
export function initialize() {}
Collapse file
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export function globalPreload() {}
Collapse file
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function globalPreload() {
2+
return '';
3+
}
Collapse file
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function initialize() {
2+
process.exit(42);
3+
}
Collapse file
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function initialize() {
2+
return new Promise(() => {});
3+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.