diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit/webcrypto_test.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cli/tests/unit/webcrypto_test.ts b/cli/tests/unit/webcrypto_test.ts index a37e32eba..475efde6c 100644 --- a/cli/tests/unit/webcrypto_test.ts +++ b/cli/tests/unit/webcrypto_test.ts @@ -254,6 +254,8 @@ const jwk: JsonWebKey = { // unpadded base64 for rawKey. k: "AQIDBAUGBwgJCgsMDQ4PEA", alg: "HS256", + ext: true, + "key_ops": ["sign"], }; unitTest(async function subtleCryptoHmacImportExport() { @@ -297,7 +299,10 @@ unitTest(async function subtleCryptoHmacImportExport() { new Uint8Array(actual2), expected, ); - // TODO(@littledivy): Add a test for exporting JWK key when supported. - const exportedKey = await crypto.subtle.exportKey("raw", key1); - assertEquals(new Uint8Array(exportedKey), rawKey); + + const exportedKey1 = await crypto.subtle.exportKey("raw", key1); + assertEquals(new Uint8Array(exportedKey1), rawKey); + + const exportedKey2 = await crypto.subtle.exportKey("jwk", key2); + assertEquals(exportedKey2, jwk); }); |