Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: adding test coverage for SourceTextModule.evaluate
This checks that invalid option throws an error.
  • Loading branch information
kaltepeter committed Oct 12, 2018
commit 704bc13f88b9d798915c0faa98e9d3d5a02eebe2
8 changes: 8 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,14 @@ 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