Skip to content
Closed
Prev Previous commit
Next Next commit
test: add test call Cipher with cipher is string and password is not …
…string
  • Loading branch information
Leko committed Dec 4, 2017
commit bb5c70d738d2a40be99d9530b9c3f894d6338bfd
9 changes: 9 additions & 0 deletions test/parallel/test-crypto-cipher-decipher.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ testCipher2(Buffer.from('0123456789abcdef'));
type: TypeError,
message: 'The "cipher" argument must be of type string'
});

common.expectsError(
() => new Cipher('aes-256-cbc', null),
{
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError,
message: 'The "password" argument must be one of type string, Buffer, ' +
'TypedArray, or DataView'
});
}

{
Expand Down