node/test/fixtures/es-module-loaders/missing-dynamic-instantiate-hook.mjs
Jacob Smith 447635b440
test: refactor ESM tests to improve performance
PR-URL: https://github.com/nodejs/node/pull/43784
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-07-29 10:42:55 +02:00

17 lines
351 B
JavaScript

export function resolve(specifier, context, next) {
if (specifier === 'test') {
return {
url: 'file://'
};
}
return next(specifier);
}
export function getFormat(url, context, defaultGetFormat) {
if (url === 'file://') {
return {
format: 'dynamic'
}
}
return defaultGetFormat(url, context, defaultGetFormat);
}