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 <[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]>
  • Loading branch information
f48vj authored and addaleax committed Jul 18, 2017
1 parent bf663a8 commit 0f52b41
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 @@ -264,4 +264,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 0f52b41

Please sign in to comment.