Browse Source

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>
v6.x
Matej Krajčovič 8 years ago
committed by Myles Borins
parent
commit
a3f327fd21
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 2
      test/parallel/test-vm-run-in-new-context.js

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

@ -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');

Loading…
Cancel
Save