test: fix crypto test case

PR-URL: https://github.com/nodejs/node/pull/22126
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Tobias Nießen 2018-08-04 18:39:45 +02:00
parent 346f2a7bec
commit 34f56e2d71
No known key found for this signature in database
GPG Key ID: 718207F8FD156B70

View File

@ -112,15 +112,6 @@ testCipher2(Buffer.from('0123456789abcdef'));
'TypedArray, or DataView. Received type object'
});
common.expectsError(
() => crypto.createCipher('aes-256-cbc', 'secret').setAuthTag(null),
{
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError,
message: 'The "buffer" argument must be one of type Buffer, ' +
'TypedArray, or DataView. Received type object'
});
common.expectsError(
() => crypto.createCipher('aes-256-cbc', 'secret').setAAD(null),
{
@ -146,6 +137,15 @@ testCipher2(Buffer.from('0123456789abcdef'));
'Received type object'
});
common.expectsError(
() => crypto.createDecipher('aes-256-cbc', 'secret').setAuthTag(null),
{
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError,
message: 'The "buffer" argument must be one of type Buffer, ' +
'TypedArray, or DataView. Received type object'
});
common.expectsError(
() => crypto.createDecipher('aes-256-cbc', null),
{