node/test/es-module/test-esm-exports-pending-de...

20 lines
480 B
JavaScript

// Flags: --pending-deprecation
import { mustCall } from '../common/index.mjs';
import assert from 'assert';
let curWarning = 0;
const expectedWarnings = [
'"./sub/"',
'"./fallbackdir/"',
'"./subpath/"'
];
process.addListener('warning', mustCall((warning) => {
assert(warning.stack.includes(expectedWarnings[curWarning++]), warning.stack);
}, expectedWarnings.length));
(async () => {
await import('./test-esm-exports.mjs');
})()
.catch((err) => console.error(err));