• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Flags: --pending-deprecation
2import { mustCall } from '../common/index.mjs';
3import assert from 'assert';
4
5let curWarning = 0;
6const expectedWarnings = [
7  'Use of deprecated leading or trailing slash',
8  'Use of deprecated double slash',
9  './/asdf.js',
10  '".//internal/test.js"',
11  '".//internal//test.js"',
12  '"./////internal/////test.js"',
13  '"./trailing-pattern-slash/"',
14  '"./subpath/dir1/dir1.js"',
15  '"./subpath//dir1/dir1.js"',
16  './/asdf.js',
17  '".//internal/test.js"',
18  '".//internal//test.js"',
19  '"./////internal/////test.js"',
20  'no_exports',
21  'default_index',
22];
23
24process.addListener('warning', mustCall((warning) => {
25  assert(warning.stack.includes(expectedWarnings[curWarning++]), warning.stack);
26}, expectedWarnings.length));
27
28await import('./test-esm-exports.mjs');
29