mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
53633c033d
PR-URL: https://github.com/nodejs/node/pull/44477 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
29 lines
792 B
JavaScript
29 lines
792 B
JavaScript
// Flags: --pending-deprecation
|
|
import { mustCall } from '../common/index.mjs';
|
|
import assert from 'assert';
|
|
|
|
let curWarning = 0;
|
|
const expectedWarnings = [
|
|
'Use of deprecated leading or trailing slash',
|
|
'Use of deprecated double slash',
|
|
'.//asdf.js',
|
|
'".//internal/test.js"',
|
|
'".//internal//test.js"',
|
|
'"./////internal/////test.js"',
|
|
'"./trailing-pattern-slash/"',
|
|
'"./subpath/dir1/dir1.js"',
|
|
'"./subpath//dir1/dir1.js"',
|
|
'.//asdf.js',
|
|
'".//internal/test.js"',
|
|
'".//internal//test.js"',
|
|
'"./////internal/////test.js"',
|
|
'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');
|