Skip to content
Closed
Prev Previous commit
Next Next commit
test: add test call Cipher with cipher is not string
  • Loading branch information
Leko committed Dec 4, 2017
commit 569099c7e1df0adbe1818dc492c95a4a0b898bf8
8 changes: 8 additions & 0 deletions test/parallel/test-crypto-cipher-decipher.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ testCipher2(Buffer.from('0123456789abcdef'));
const instance = crypto.Cipher('aes-256-cbc', 'secret');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createCipher

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same adobe #17458 (comment)

assert(instance instanceof Cipher, 'Cipher is expected to return a new ' +
'instance when called without `new`');

common.expectsError(
() => new Cipher(null),
{
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError,
message: 'The "cipher" argument must be of type string'
});
}

{
Expand Down