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: nodejs#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 jungx098 committed Mar 21, 2017
1 parent 67320f2 commit 39e47f6
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 @@ -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');
Expand Down

0 comments on commit 39e47f6

Please sign in to comment.