xref: /third_party/node/test/es-module/test-esm-loader-custom-condition.mjs
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/es-module/
11cb0ef41Sopenharmony_ci// Flags: --experimental-loader ./test/fixtures/es-module-loaders/loader-with-custom-condition.mjs
21cb0ef41Sopenharmony_ciimport '../common/index.mjs';
31cb0ef41Sopenharmony_ciimport assert from 'assert';
41cb0ef41Sopenharmony_ciimport util from 'util';
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ciimport * as ns from '../fixtures/es-modules/conditional-exports.mjs';
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ciassert.deepStrictEqual({ ...ns }, { default: 'from custom condition' });
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ciassert.strictEqual(
111cb0ef41Sopenharmony_ci  util.inspect(ns, { showHidden: false }),
121cb0ef41Sopenharmony_ci  "[Module: null prototype] { default: 'from custom condition' }"
131cb0ef41Sopenharmony_ci);
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_ciassert.strictEqual(
161cb0ef41Sopenharmony_ci  util.inspect(ns, { showHidden: true }),
171cb0ef41Sopenharmony_ci  '[Module: null prototype] {\n' +
181cb0ef41Sopenharmony_ci  "  default: 'from custom condition',\n" +
191cb0ef41Sopenharmony_ci  "  [Symbol(Symbol.toStringTag)]: 'Module'\n" +
201cb0ef41Sopenharmony_ci  '}'
211cb0ef41Sopenharmony_ci);
22

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