2022-09-11 18:01:37 +08:00
|
|
|
// Flags: --pending-deprecation
|
2020-10-22 08:40:24 +08:00
|
|
|
import { mustCall } from '../common/index.mjs';
|
|
|
|
import assert from 'assert';
|
|
|
|
|
|
|
|
let curWarning = 0;
|
|
|
|
const expectedWarnings = [
|
2022-09-11 18:01:37 +08:00
|
|
|
'Use of deprecated leading or trailing slash',
|
|
|
|
'Use of deprecated double slash',
|
|
|
|
'.//asdf.js',
|
|
|
|
'".//internal/test.js"',
|
|
|
|
'".//internal//test.js"',
|
|
|
|
'"./////internal/////test.js"',
|
2021-09-09 01:36:52 +08:00
|
|
|
'"./trailing-pattern-slash/"',
|
2022-09-11 18:01:37 +08:00
|
|
|
'"./subpath/dir1/dir1.js"',
|
|
|
|
'"./subpath//dir1/dir1.js"',
|
|
|
|
'.//asdf.js',
|
|
|
|
'".//internal/test.js"',
|
|
|
|
'".//internal//test.js"',
|
|
|
|
'"./////internal/////test.js"',
|
2021-01-14 05:09:17 +08:00
|
|
|
'no_exports',
|
2021-03-26 23:51:08 +08:00
|
|
|
'default_index',
|
2020-10-22 08:40:24 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
process.addListener('warning', mustCall((warning) => {
|
|
|
|
assert(warning.stack.includes(expectedWarnings[curWarning++]), warning.stack);
|
|
|
|
}, expectedWarnings.length));
|
|
|
|
|
2021-05-23 23:20:44 +08:00
|
|
|
await import('./test-esm-exports.mjs');
|