mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
PR-URL: https://github.com/nodejs/node/pull/24183 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
13 lines
434 B
JavaScript
13 lines
434 B
JavaScript
// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/loader-unknown-builtin-module.mjs
|
|
import { expectsError, mustCall } from '../common';
|
|
import assert from 'assert';
|
|
|
|
const unknownBuiltinModule = 'unknown-builtin-module';
|
|
|
|
import(unknownBuiltinModule)
|
|
.then(assert.fail, expectsError({
|
|
code: 'ERR_UNKNOWN_BUILTIN_MODULE',
|
|
message: `No such built-in module: ${unknownBuiltinModule}`
|
|
}))
|
|
.then(mustCall());
|