import { describe, expect, test } from 'vitest' import { buildCreateKeypair } from './create-keypair.js' /** * Although this case is testing library code under the hood, it is helpful * out of documentation reasons. */ describe('The createKeypair function', () => { test('should be able to generate a SigningKeypair (JWK)', async () => { const createKeypair = buildCreateKeypair() const keypair = await createKeypair() expect(Object.keys(keypair.value?.privateKey ?? {})).toMatchInlineSnapshot(` [ "crv", "d", "x", "kty", ] `) expect(Object.keys(keypair.value?.publicKey ?? {})).toMatchInlineSnapshot(` [ "crv", "x", "kty", ] `) }) })