Skip to content
Prev Previous commit
Next Next commit
lint(crypto): fix js lint for randomInt
  • Loading branch information
olalonde committed Aug 6, 2020
commit d6df4b92263357c38c70d7699675f63205f65ce5
30 changes: 18 additions & 12 deletions test/parallel/test-crypto-random.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,19 +434,25 @@ assert.throws(
crypto.randomInt(minInt, minInt + 5, common.mustCall());
crypto.randomInt(maxInt - 5, maxInt, common.mustCall());

assert.throws(() => crypto.randomInt(minInt - 1, minInt + 5, common.mustNotCall()), {
code: 'ERR_INVALID_ARG_TYPE',
name: 'TypeError',
message: 'The "min" argument must be safe integer.' +
`${common.invalidArgTypeHelper(minInt - 1)}`,
});
assert.throws(
() => crypto.randomInt(minInt - 1, minInt + 5, common.mustNotCall()),
{
code: 'ERR_INVALID_ARG_TYPE',
name: 'TypeError',
message: 'The "min" argument must be safe integer.' +
`${common.invalidArgTypeHelper(minInt - 1)}`,
}
);

assert.throws(() => crypto.randomInt(maxInt - 5, maxInt + 1, common.mustNotCall()), {
code: 'ERR_INVALID_ARG_TYPE',
name: 'TypeError',
message: 'The "max" argument must be safe integer.' +
`${common.invalidArgTypeHelper(maxInt + 1)}`,
});
assert.throws(
() => crypto.randomInt(maxInt - 5, maxInt + 1, common.mustNotCall()),
{
code: 'ERR_INVALID_ARG_TYPE',
name: 'TypeError',
message: 'The "max" argument must be safe integer.' +
`${common.invalidArgTypeHelper(maxInt + 1)}`,
}
);


assert.throws(() => crypto.randomInt(0, 0, common.mustNotCall()), {
Expand Down