node/test/fixtures/module-mocking/wrong-import-after-module-mocking.js
2024-08-06 11:24:24 +02:00

8 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'