Skip to content

Commit

Permalink
test: add a JWK export/import roundtrip test
Browse files Browse the repository at this point in the history
refs #178
  • Loading branch information
panva committed Apr 13, 2021
1 parent 5a7078a commit 1477592
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/jwk/jwk2key.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ Promise.all([import(`${keyRoot}/jwk/parse`), import(`${keyRoot}/jwk/from_key_lik

async function testKeyImportExport(t, jwk) {
await t.notThrowsAsync(async () => {
const key = await parseJwk(jwk);
let key = await parseJwk({ ...jwk, ext: true });
t.is(key.type, 'private');
const exportedJwk = await fromKeyLike(key)
key = await parseJwk(exportedJwk, jwk.alg);
t.is(key.type, 'private');
});
await t.notThrowsAsync(async () => {
Expand Down

0 comments on commit 1477592

Please sign in to comment.