Permalink
Browse files

test: add regex to assert.throws

Make sure test matches this specific error message.

PR-URL: #11815
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
matejkrajcovic authored and jasnell committed Mar 12, 2017
1 parent bc26c62 commit 22819446123efb68313f2ae385e57d1e780f6b50
Showing with 1 addition and 1 deletion.
  1. +1 −1 test/parallel/test-vm-run-in-new-context.js
@@ -38,7 +38,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');

0 comments on commit 2281944

Please sign in to comment.