Skip to content

Commit 0f52b41

Browse files
f48vjaddaleax
authored andcommitted
test: use regex error check in test-crypto-random
Replace constructor in assert.throws() to a regular expression to check the error thrown in a test in test-crypto-random. PR-URL: #14273 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent bf663a8 commit 0f52b41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/parallel/test-crypto-random.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,4 +264,4 @@ const expectedErrorRegexp = /^TypeError: size must be a number >= 0$/;
264264
// length exceeds max acceptable value"
265265
assert.throws(function() {
266266
crypto.randomBytes((-1 >>> 0) + 1);
267-
}, TypeError);
267+
}, /^TypeError: size must be a number >= 0$/);

0 commit comments

Comments
 (0)