0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/es-module/test-esm-loader-get-format.mjs
Geoffrey Booth 2551a21553 module: loader getSource, getFormat, transform hooks
PR-URL: https://github.com/nodejs/node/pull/30986
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
2020-01-07 01:31:05 +02:00

13 lines
400 B
JavaScript

// Flags: --experimental-loader ./test/fixtures/es-module-loaders/loader-get-format.mjs
import { mustCall, mustNotCall } from '../common/index.mjs';
import assert from 'assert';
import('../fixtures/es-modules/package-type-module/extension.unknown')
.then(
mustCall((ns) => {
assert.strictEqual(ns.default, 'unknown');
}),
// Do not use .catch; want exclusive or
mustNotCall(() => {})
);