Skip to content

Commit f402ca5

Browse files
committed
fixup! test: add CryptoKey class regression tests
1 parent 1af292c commit f402ca5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/parallel/test-webcrypto-internal-slots.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,11 @@ assert.ok(kp.publicKey.usages.includes('foo'));
1818
assert.ok(util.inspect(kp.publicKey).includes("algorithm: { name: 'Ed25519' }"));
1919
assert.ok(util.inspect(kp.publicKey).includes("usages: [ 'verify' ]"));
2020

21+
const jwk = await subtle.exportKey('jwk', kp.publicKey);
22+
assert.deepStrictEqual(jwk.key_ops, ['verify']);
23+
jwk.key_ops.push('foo');
24+
assert.ok(!util.inspect(kp.publicKey).includes('foo'));
25+
assert.deepStrictEqual((await subtle.exportKey('jwk', kp.publicKey)).key_ops,
26+
['verify']);
27+
2128
await subtle.sign('Ed25519', kp.privateKey, Buffer.alloc(32));

0 commit comments

Comments
 (0)