mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
test: adding test coverage for SourceTextModule.evaluate
This checks that invalid option throws an error. PR-URL: https://github.com/nodejs/node/pull/23595 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
This commit is contained in:
parent
b2d8ae0a14
commit
6cd5c7420a
1 changed files with 9 additions and 0 deletions
|
@ -131,6 +131,15 @@ async function checkModuleState() {
|
|||
message: 'Module status must be one of instantiated, evaluated, and errored'
|
||||
});
|
||||
|
||||
await expectsRejection(async () => {
|
||||
const m = new SourceTextModule('');
|
||||
await m.evaluate(false);
|
||||
}, {
|
||||
code: 'ERR_INVALID_ARG_TYPE',
|
||||
message: 'The "options" argument must be of type Object. ' +
|
||||
'Received type boolean'
|
||||
});
|
||||
|
||||
await expectsRejection(async () => {
|
||||
const m = await createEmptyLinkedModule();
|
||||
await m.evaluate();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue