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 944ae59

Browse filesBrowse files
xiciliontargos
authored andcommitted
test, crypto: use correct object on assert
The test case for KeyObject does not really test the creation of asymmetric cryptographic keys using jwk because of a misspelling of the variable. PR-URL: #51820 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent 0f5716c commit 944ae59
Copy full SHA for 944ae59

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+8
-8
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
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,16 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
169169
assert.strictEqual(derivedPublicKey.symmetricKeySize, undefined);
170170

171171
const publicKeyFromJwk = createPublicKey({ key: publicJwk, format: 'jwk' });
172-
assert.strictEqual(publicKey.type, 'public');
173-
assert.strictEqual(publicKey.toString(), '[object KeyObject]');
174-
assert.strictEqual(publicKey.asymmetricKeyType, 'rsa');
175-
assert.strictEqual(publicKey.symmetricKeySize, undefined);
172+
assert.strictEqual(publicKeyFromJwk.type, 'public');
173+
assert.strictEqual(publicKeyFromJwk.toString(), '[object KeyObject]');
174+
assert.strictEqual(publicKeyFromJwk.asymmetricKeyType, 'rsa');
175+
assert.strictEqual(publicKeyFromJwk.symmetricKeySize, undefined);
176176

177177
const privateKeyFromJwk = createPrivateKey({ key: jwk, format: 'jwk' });
178-
assert.strictEqual(privateKey.type, 'private');
179-
assert.strictEqual(privateKey.toString(), '[object KeyObject]');
180-
assert.strictEqual(privateKey.asymmetricKeyType, 'rsa');
181-
assert.strictEqual(privateKey.symmetricKeySize, undefined);
178+
assert.strictEqual(privateKeyFromJwk.type, 'private');
179+
assert.strictEqual(privateKeyFromJwk.toString(), '[object KeyObject]');
180+
assert.strictEqual(privateKeyFromJwk.asymmetricKeyType, 'rsa');
181+
assert.strictEqual(privateKeyFromJwk.symmetricKeySize, undefined);
182182

183183
// It should also be possible to import an encrypted private key as a public
184184
// key.

0 commit comments

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