node/test/fixtures/module-mocking/wrong-import-after-module-m...

9 lines
267 B
JavaScript

import { mock } from 'node:test';
try {
mock.module?.('Whatever, this is not significant', { namedExports: {} });
} catch {}
const { string } = await import('./basic-esm-without-extension');
console.log(`Found string: ${string}`); // prints 'original esm string'