Skip to content
Permalink
Browse files
test: add regex check in test-vm-is-context
Use a regex to validate the error message.

PR-URL: #12785
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Jeyanthinath authored and lpinca committed May 5, 2017
1 parent 53c88fa commit bc05436
Showing 1 changed file with 1 addition and 1 deletion.
@@ -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);

0 comments on commit bc05436

Please sign in to comment.