Skip to content

Commit

Permalink
test: adding test coverage for SourceTextModule.evaluate
Browse files Browse the repository at this point in the history
This checks that invalid option throws an error.

PR-URL: #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>
  • Loading branch information
kaltepeter authored and jasnell committed Oct 17, 2018
1 parent 07682eb commit 0579784
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/parallel/test-vm-module-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 0579784

Please sign in to comment.