Skip to content

Commit c9cf922

Browse files
matejkrajcovicitaloacasas
authored andcommitted
test: add regex to assert.throws
Make sure test matches this specific error message. PR-URL: #11815 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 5f6025b commit c9cf922

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ assert.strictEqual('passed', result);
1717
console.error('thrown error');
1818
assert.throws(function() {
1919
vm.runInNewContext('throw new Error(\'test\');');
20-
});
20+
}, /^Error: test$/);
2121

2222
global.hello = 5;
2323
vm.runInNewContext('hello = 2');

0 commit comments

Comments
 (0)