Skip to content
Closed
Prev Previous commit
Next Next commit
test: add test call Decipher with cipher is not string
  • Loading branch information
Leko committed Dec 4, 2017
commit 4ebbe674c4829a15bfd63638fc3903d41735e755
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 @@ -126,6 +126,14 @@ testCipher2(Buffer.from('0123456789abcdef'));
const instance = crypto.Decipher('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.

createDecipher

assert(instance instanceof Decipher, 'Decipher is expected to return a new ' +
'instance when called without `new`');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: indent once more.

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.

I made a silly mistake.
I'll fix it soon.


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

// Base64 padding regression test, see #4837.
Expand Down