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/node#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 andrew749 committed Jul 19, 2017
1 parent d070f81 commit c521c1a
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 c521c1a

Please sign in to comment.