2020-01-11 02:27:07 +08:00
|
|
|
// Flags: --experimental-loader ./test/fixtures/es-module-loaders/loader-with-custom-condition.mjs
|
|
|
|
import '../common/index.mjs';
|
|
|
|
import assert from 'assert';
|
2020-11-19 23:31:05 +08:00
|
|
|
import util from 'util';
|
2020-01-11 02:27:07 +08:00
|
|
|
|
|
|
|
import * as ns from '../fixtures/es-modules/conditional-exports.mjs';
|
|
|
|
|
|
|
|
assert.deepStrictEqual({ ...ns }, { default: 'from custom condition' });
|
2020-11-19 23:31:05 +08:00
|
|
|
|
|
|
|
assert.strictEqual(
|
|
|
|
util.inspect(ns, { showHidden: false }),
|
|
|
|
"[Module: null prototype] { default: 'from custom condition' }"
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.strictEqual(
|
|
|
|
util.inspect(ns, { showHidden: true }),
|
|
|
|
'[Module: null prototype] {\n' +
|
|
|
|
" default: 'from custom condition',\n" +
|
|
|
|
" [Symbol(Symbol.toStringTag)]: 'Module'\n" +
|
|
|
|
'}'
|
|
|
|
);
|