Files
Kmake/test/module-hooks/test-module-hooks-load-context-optional-esm.mjs
2026-05-26 23:36:42 -07:00

15 lines
372 B
JavaScript

// Test that the context parameter can be omitted in the nextLoad invocation.
import * as common from '../common/index.mjs';
import { registerHooks } from 'node:module';
const hook = registerHooks({
load: common.mustCall(function(url, context, nextLoad) {
return nextLoad(url);
}, 1),
});
await import('../fixtures/es-modules/message.mjs');
hook.deregister();