mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: crypto KeyObject.from() ERR_INVALID_ARG_TYPE
PR-URL: https://github.com/nodejs/node/pull/37890 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
This commit is contained in:
1 parent
9ad611c0b2
commit
67e9e71f75
1 file changed
+10
@@ -66,6 +66,16 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
assert.throws(() => KeyObject.from('invalid_key'), {
|
||||
name: 'TypeError',
|
||||
code: 'ERR_INVALID_ARG_TYPE',
|
||||
message:
|
||||
'The "key" argument must be an instance of CryptoKey. Received type ' +
|
||||
"string ('invalid_key')"
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
const keybuf = randomBytes(32);
|
||||
const key = createSecretKey(keybuf);
|
||||
|
||||
Reference in new issue
Block a user