mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
PR-URL: https://github.com/nodejs/node/pull/58992 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
17 lines
410 B
JavaScript
17 lines
410 B
JavaScript
// This tests that after failing to require an ESM that throws,
|
|
// retrying with import() still rejects.
|
|
|
|
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
assert.throws(() => {
|
|
require('../fixtures/es-modules/throw-error.mjs');
|
|
}, {
|
|
message: 'test',
|
|
});
|
|
|
|
assert.rejects(import('../fixtures/es-modules/throw-error.mjs'), {
|
|
message: 'test',
|
|
}).then(common.mustCall());
|