Skip to content

Commit

Permalink
test: use regex error check in test-crypto-random
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
f48vj authored and MylesBorins committed Aug 16, 2017
1 parent d73735b commit 94181d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-random.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ const expectedErrorRegexp = /^TypeError: size must be a number >= 0$/;
// length exceeds max acceptable value"
assert.throws(function() {
crypto.randomBytes((-1 >>> 0) + 1);
}, TypeError);
}, /^TypeError: size must be a number >= 0$/);

0 comments on commit 94181d1

Please sign in to comment.