node/test/es-module/test-esm-exports-deprecatio...

16 lines
404 B
JavaScript

import { mustCall } from '../common/index.mjs';
import assert from 'assert';
let curWarning = 0;
const expectedWarnings = [
'"./trailing-pattern-slash/"',
'no_exports',
'default_index',
];
process.addListener('warning', mustCall((warning) => {
assert(warning.stack.includes(expectedWarnings[curWarning++]), warning.stack);
}, expectedWarnings.length));
await import('./test-esm-exports.mjs');