mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: add regex to assert.throws
Make sure test matches this specific error message. PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
4d916da0d7
commit
a3f327fd21
1 file changed
+1
-1
@@ -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');
|
||||
|
||||
Reference in new issue
Block a user