xref: /third_party/node/test/es-module/test-esm-imports-deprecations.mjs
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/es-module/
11cb0ef41Sopenharmony_ci// Flags: --pending-deprecation
21cb0ef41Sopenharmony_ciimport { mustCall } from '../common/index.mjs';
31cb0ef41Sopenharmony_ciimport assert from 'assert';
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_cilet curWarning = 0;
61cb0ef41Sopenharmony_ciconst expectedWarnings = [
71cb0ef41Sopenharmony_ci  'Use of deprecated double slash',
81cb0ef41Sopenharmony_ci  'Use of deprecated double slash',
91cb0ef41Sopenharmony_ci  './sub//null',
101cb0ef41Sopenharmony_ci  './sub/////null',
111cb0ef41Sopenharmony_ci  './sub//internal/test',
121cb0ef41Sopenharmony_ci  './sub//internal//test',
131cb0ef41Sopenharmony_ci  '#subpath/////internal',
141cb0ef41Sopenharmony_ci  '#subpath//asdf.asdf',
151cb0ef41Sopenharmony_ci  '#subpath/as//df.asdf',
161cb0ef41Sopenharmony_ci  './sub//null',
171cb0ef41Sopenharmony_ci  './sub/////null',
181cb0ef41Sopenharmony_ci  './sub//internal/test',
191cb0ef41Sopenharmony_ci  './sub//internal//test',
201cb0ef41Sopenharmony_ci  '#subpath/////internal',
211cb0ef41Sopenharmony_ci];
221cb0ef41Sopenharmony_ci
231cb0ef41Sopenharmony_ciprocess.addListener('warning', mustCall((warning) => {
241cb0ef41Sopenharmony_ci  assert(warning.stack.includes(expectedWarnings[curWarning++]), warning.stack);
251cb0ef41Sopenharmony_ci}, expectedWarnings.length));
261cb0ef41Sopenharmony_ci
271cb0ef41Sopenharmony_ciawait import('./test-esm-imports.mjs');
28

Indexes created Thu Nov 07 10:32:03 CST 2024