Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: add test case where call randomFill with argument cb is not a f…
…unction
  • Loading branch information
Leko committed Dec 8, 2017
commit 512f34f096807df562de071e34bba8ffe00d41bb
11 changes: 11 additions & 0 deletions test/parallel/test-crypto-random.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ process.setMaxListeners(256);
assert.notStrictEqual(before, after);
}

{
const buf = Buffer.alloc(10);
common.expectsError(
() => crypto.randomFill(buf, 0, 10, null),
{
code: 'ERR_INVALID_CALLBACK',
type: TypeError,
message: 'Callback must be a function',
});
}

{
const buf = Buffer.alloc(10);
const before = buf.toString('hex');
Expand Down