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 <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
  • Loading branch information
kaltepeter authored and MylesBorins committed Nov 29, 2018
1 parent 9003c74 commit f55b4f1
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 f55b4f1

Please sign in to comment.