mirror of
https://github.com/nodejs/node.git
synced 2024-11-29 23:16:30 +01:00
15fb02a515
Renames the `--loader` cli argument to `--experimental-loader`. This is to clearly indicate the esm loader feature as experimental even after esm is no longer experimental. Also minorly alters the `--experimental-loader` docs to say that the passed loader can be an esm module. Refs: https://github.com/nodejs/modules/issues/351#issuecomment-535189524 PR-URL: https://github.com/nodejs/node/pull/29752 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
12 lines
494 B
JavaScript
12 lines
494 B
JavaScript
// Flags: --experimental-modules --experimental-loader ./test/fixtures/es-module-loaders/loader-invalid-format.mjs
|
|
import { expectsError, mustCall } from '../common/index.mjs';
|
|
import assert from 'assert';
|
|
|
|
import('../fixtures/es-modules/test-esm-ok.mjs')
|
|
.then(assert.fail, expectsError({
|
|
code: 'ERR_INVALID_RETURN_PROPERTY_VALUE',
|
|
message: 'Expected string to be returned for the "format" from the ' +
|
|
'"loader resolve" function but got type undefined.'
|
|
}))
|
|
.then(mustCall());
|