xref: /third_party/node/test/es-module/test-esm-loader-search.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/es-module/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci// Flags: --expose-internals
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_ci// This test ensures that search throws errors appropriately
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_cirequire('../common');
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ciconst assert = require('assert');
91cb0ef41Sopenharmony_ciconst {
101cb0ef41Sopenharmony_ci  defaultResolve: resolve
111cb0ef41Sopenharmony_ci} = require('internal/modules/esm/resolve');
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_ciassert.throws(
141cb0ef41Sopenharmony_ci  () => resolve('target'),
151cb0ef41Sopenharmony_ci  {
161cb0ef41Sopenharmony_ci    code: 'ERR_MODULE_NOT_FOUND',
171cb0ef41Sopenharmony_ci    name: 'Error',
181cb0ef41Sopenharmony_ci    message: /Cannot find package 'target'/
191cb0ef41Sopenharmony_ci  }
201cb0ef41Sopenharmony_ci);
21

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