summaryrefslogtreecommitdiff
path: root/test/parallel/test-loaders-unknown-builtin-module.mjs
blob: db3cfa3582e9e2e4d17d12735a952d4e1ebb174a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// 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());