Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 67e9e71

Browse filesBrowse files
peZhmanParsaeetargos
authored andcommitted
test: crypto KeyObject.from() ERR_INVALID_ARG_TYPE
PR-URL: #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>
1 parent 9ad611c commit 67e9e71
Copy full SHA for 67e9e71

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-crypto-key-objects.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-crypto-key-objects.js
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
6666
});
6767
}
6868

69+
{
70+
assert.throws(() => KeyObject.from('invalid_key'), {
71+
name: 'TypeError',
72+
code: 'ERR_INVALID_ARG_TYPE',
73+
message:
74+
'The "key" argument must be an instance of CryptoKey. Received type ' +
75+
"string ('invalid_key')"
76+
});
77+
}
78+
6979
{
7080
const keybuf = randomBytes(32);
7181
const key = createSecretKey(keybuf);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.