Skip to content

Commit

Permalink
test: add regex check in test-vm-is-context
Browse files Browse the repository at this point in the history
Use a regex to validate the error message.

PR-URL: nodejs#12785
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Jeyanthinath authored and Olivier Martin committed May 6, 2017
1 parent 4950185 commit 6242f1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-vm-is-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const vm = require('vm');

assert.throws(function() {
vm.isContext('string is not supported');
}, TypeError);
}, /^TypeError: sandbox must be an object$/);

assert.strictEqual(vm.isContext({}), false);
assert.strictEqual(vm.isContext([]), false);
Expand Down

0 comments on commit 6242f1a

Please sign in to comment.