Skip to content

Commit

Permalink
test: add regex to assert.throws
Browse files Browse the repository at this point in the history
Make sure test matches this specific error message.

PR-URL: #11815
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
matejkrajcovic authored and italoacasas committed Mar 20, 2017
1 parent 5f6025b commit c9cf922
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-vm-run-in-new-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ assert.strictEqual('passed', result);
console.error('thrown error');
assert.throws(function() {
vm.runInNewContext('throw new Error(\'test\');');
});
}, /^Error: test$/);

global.hello = 5;
vm.runInNewContext('hello = 2');
Expand Down

0 comments on commit c9cf922

Please sign in to comment.