Skip to content
Closed
Prev Previous commit
Next Next commit
test: add test call Decipher withour new keyword
  • Loading branch information
Leko committed Dec 4, 2017
commit 24553fa4a818fd1fc75373efef2d6d2b291533ea
7 changes: 7 additions & 0 deletions test/parallel/test-crypto-cipher-decipher.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ testCipher2(Buffer.from('0123456789abcdef'));
'instance when called without `new`');
}

{
const Decipher = crypto.Decipher;
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.

}

// Base64 padding regression test, see #4837.
{
const c = crypto.createCipher('aes-256-cbc', 'secret');
Expand Down