Skip to content

Commit 7a8eddf

Browse files
f48vjMylesBorins
authored andcommittedSep 5, 2017
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 <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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)
Please sign in to comment.