Skip to content

Commit 7a8eddf

Browse files
f48vjMylesBorins
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 3047cf1 commit 7a8eddf

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
@@ -32,4 +32,4 @@ const expectedErrorRegexp = /^TypeError: size must be a number >= 0$/;
3232
// length exceeds max acceptable value"
3333
assert.throws(function() {
3434
crypto.randomBytes((-1 >>> 0) + 1);
35-
}, TypeError);
35+
}, /^TypeError: size must be a number >= 0$/);

0 commit comments

Comments
 (0)