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>
20 lines
614 B
JavaScript
20 lines
614 B
JavaScript
// Test import.meta.resolve of a never-settling resolve should throw in ESM files
|
|
import '../common/index.mjs';
|
|
import { execPath } from 'node:process';
|
|
import fixtures from '../common/fixtures.js';
|
|
import { spawnSyncAndAssert } from '../common/child_process.js';
|
|
|
|
spawnSyncAndAssert(
|
|
execPath,
|
|
[
|
|
'--no-warnings',
|
|
'--experimental-loader',
|
|
fixtures.fileURL('es-module-loaders/never-settling-resolve-step/loader.mjs'),
|
|
fixtures.path('es-module-loaders/never-settling-resolve-step/import.meta.never-resolve.mjs'),
|
|
],
|
|
{
|
|
stdout: /^should be output$/,
|
|
stderr: '',
|
|
trim: true,
|
|
},
|
|
);
|