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
Prev Previous commit
Next Next commit
test: Add test call Hmac with hmac=string, key=null
  • Loading branch information
Leko committed Dec 4, 2017
commit cfa073ab4f27729af1e1e2c9186e787f85ac10d3
9 changes: 9 additions & 0 deletions test/parallel/test-crypto-hmac.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ common.expectsError(
message: 'The "hmac" argument must be of type string'
});

common.expectsError(
() => new crypto.Hmac('sha1', null),
{
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError,
message: 'The "key" argument must be one of type string, TypedArray, or ' +
'DataView'
});

{
// Test HMAC
const actual = crypto.createHmac('sha1', 'Node')
Expand Down