fix: test setup by generating keypair within test function

This commit is contained in:
Shibo Lyu 2025-05-11 02:17:30 +08:00
parent 850b5b3042
commit 5e6a51e172

View file

@ -4,9 +4,11 @@ import { z } from "zod";
import { BlahPublicKey } from "./publicKey.ts";
import type { SignOrVerifyOptions } from "./signAndVerify.ts";
const keypair = await BlahKeyPair.generate();
let keypair: BlahKeyPair;
Deno.test("sign & verify payload", async () => {
keypair = await BlahKeyPair.generate();
const payload = { foo: "bar", baz: 123 };
const signedPayload = await keypair.signPayload(payload);
const verifiedPayload = await keypair.publicKey.verifyPayload(