Avoid potentially huge messages and leaked secrets. PR-URL: https://github.com/nodejs/node/pull/38614 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
14 lines
448 B
JavaScript
14 lines
448 B
JavaScript
// Flags: --experimental-loader ./test/fixtures/es-module-loaders/loader-invalid-url.mjs
|
|
import { expectsError, mustCall } from '../common/index.mjs';
|
|
import assert from 'assert';
|
|
|
|
import('../fixtures/es-modules/test-esm-ok.mjs')
|
|
.then(assert.fail, (error) => {
|
|
expectsError({
|
|
code: 'ERR_INVALID_URL',
|
|
message: 'Invalid URL'
|
|
})(error);
|
|
|
|
assert.strictEqual(error.input, '../fixtures/es-modules/test-esm-ok.mjs');
|
|
})
|
|
.then(mustCall());
|