node/test/fixtures/es-module-loaders
Joyee Cheung 3da4dce296
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: https://github.com/nodejs/node/pull/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>
2026-01-16 14:30:12 +00:00
..
never-settling-resolve-step
node_modules
assertionless-json-import.mjs
builtin-named-exports-loader.mjs
builtin-named-exports.mjs
byop-dummy-loader.mjs
example-loader.mjs
hook-resolve-type-loader.mjs
hook-resolve-type.mjs
hooks-custom.mjs
hooks-initialize-port.mjs
hooks-initialize.mjs
hooks-input.mjs
http-loader.mjs
js-as-esm.js
loader-delayed-async-load.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-dep.js
loader-edge-cases.mjs
loader-exit-on-load.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-exit-on-resolve.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-exit-top-level.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-globalpreload-and-initialize.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-globalpreload-only.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-globalpreload-with-return.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-initialize-exit.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-initialize-never-settling.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-initialize-rejecting.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-initialize-throw-null.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-invalid-format.mjs
loader-invalid-url.mjs
loader-load-bad-next-context.mjs
loader-load-bad-next-url.mjs
loader-load-commonjs-with-source.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-load-dynamic-import.mjs
loader-load-foo-or-42.mjs
loader-load-impersonating-next-url.mjs
loader-load-incomplete.mjs
loader-load-next-modified.mjs
loader-load-null-return.mjs
loader-load-passing-modified-context.mjs
loader-load-passthru.mjs
loader-load-receiving-modified-context.mjs
loader-load-source-maps.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-log-args.mjs
loader-mixed-opt-in.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-resolve-42.mjs
loader-resolve-bad-next-context.mjs
loader-resolve-bad-next-specifier.mjs
loader-resolve-dynamic-import.mjs
loader-resolve-foo.mjs
loader-resolve-incomplete.mjs
loader-resolve-multiple-next-calls.mjs
loader-resolve-next-modified.mjs
loader-resolve-null-return.mjs
loader-resolve-passing-modified-context.mjs
loader-resolve-passthru.mjs
loader-resolve-receiving-modified-context.mjs
loader-resolve-shortcircuit.mjs
loader-resolve-strip-xxx.mjs
loader-resolve-strip-yyy.mjs
loader-shared-dep.mjs
loader-this-value-inside-hook-functions.mjs
loader-throw-bigint.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-throw-boolean.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-throw-empty-object.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-throw-error.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-throw-function.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-throw-null.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-throw-number.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-throw-object.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-throw-string.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-throw-symbol.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-throw-undefined.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
loader-unknown-builtin-module.mjs
loader-with-custom-condition.mjs
loader-with-dep.mjs
loader-with-too-many-args.mjs
loader-worker-spawn.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
missing-dynamic-instantiate-hook.mjs
mock-loader.mjs
mock.mjs
module-named-exports.mjs
not-found-assert-loader.mjs
preset-cjs-source.mjs
register-hooks-with-current-cwd-parent-url.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
register-loader-with-url-parenturl.mjs test: split test-esm-loader-hooks 2026-01-16 14:30:12 +00:00
register-loader.cjs
register-loader.mjs
register-programmatically-loader-load.mjs
register-programmatically-loader-resolve.mjs
string-sources.mjs
syntax-error.mjs
thenable-load-hook-rejected-no-arguments.mjs
thenable-load-hook-rejected.mjs
thenable-load-hook.mjs
throw-undefined.mjs