Skip to content

Commit 39e47f6

Browse files
matejkrajcovicjungx098
authored andcommitted
test: add regex to assert.throws
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>
1 parent 67320f2 commit 39e47f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/parallel/test-vm-run-in-new-context.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ assert.strictEqual('passed', result);
3838
console.error('thrown error');
3939
assert.throws(function() {
4040
vm.runInNewContext('throw new Error(\'test\');');
41-
});
41+
}, /^Error: test$/);
4242

4343
global.hello = 5;
4444
vm.runInNewContext('hello = 2');

0 commit comments

Comments
 (0)