Skip to content

Commit a350159

Browse files
GeoffreyBoothdygabo
authored andcommitted
move test to more appropriate file
1 parent b3a4d48 commit a350159

File tree

2 files changed

+16
-21
lines changed

2 files changed

+16
-21
lines changed

test/es-module/test-esm-detect-ambiguous.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,22 @@ describe('--experimental-detect-module', { concurrency: !process.env.TEST_PARALL
385385
strictEqual(signal, null);
386386
});
387387
});
388+
389+
describe('should work with module customization hooks', { concurrency: true }, () => {
390+
it('should not break basic hooks functionality of substituting a module', async () => {
391+
const { code, signal, stdout, stderr } = await spawnPromisified(process.execPath, [
392+
'--experimental-detect-module',
393+
'--import',
394+
fixtures.fileURL('es-module-loaders/builtin-named-exports.mjs'),
395+
fixtures.path('es-modules/require-esm-throws-with-loaders.js'),
396+
]);
397+
398+
strictEqual(stderr, '');
399+
strictEqual(stdout, '');
400+
strictEqual(code, 0);
401+
strictEqual(signal, null);
402+
});
403+
});
388404
});
389405

390406
// Validate temporarily disabling `--abort-on-uncaught-exception`

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -781,27 +781,6 @@ describe('Loader hooks', { concurrency: !process.env.TEST_PARALLEL }, () => {
781781
}
782782
});
783783

784-
describe('should use hooks', async () => {
785-
for (const { testConfigName, additionalOptions } of [
786-
{ testConfigName: 'without --experimental-detect-module', additionalOptions: [] },
787-
{ testConfigName: 'with --experimental-detect-module', additionalOptions: ['--experimental-detect-module'] },
788-
]) {
789-
it(testConfigName, async () => {
790-
const { code, signal, stdout, stderr } = await spawnPromisified(process.execPath, [
791-
...additionalOptions,
792-
'--import',
793-
fixtures.fileURL('es-module-loaders/builtin-named-exports.mjs'),
794-
fixtures.path('es-modules/require-esm-throws-with-loaders.js'),
795-
]);
796-
797-
assert.strictEqual(stderr, '');
798-
assert.strictEqual(stdout, '');
799-
assert.strictEqual(code, 0);
800-
assert.strictEqual(signal, null);
801-
});
802-
}
803-
});
804-
805784
it('should support source maps in commonjs translator', async () => {
806785
const readFile = async () => {};
807786
const hook = `

0 commit comments

Comments
 (0)