diff options
Diffstat (limited to 'test/bun.js')
-rw-r--r-- | test/bun.js/web-crypto.test.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/bun.js/web-crypto.test.ts b/test/bun.js/web-crypto.test.ts index d7afd523c..250282b96 100644 --- a/test/bun.js/web-crypto.test.ts +++ b/test/bun.js/web-crypto.test.ts @@ -72,3 +72,20 @@ describe("Web Crypto", () => { expect(isSigValid).toBe(true); }); }); + +describe("Ed25519", () => { + describe("generateKey", () => { + it("should return CryptoKeys without namedCurve in algorithm field", async () => { + const { publicKey, privateKey } = (await crypto.subtle.generateKey("Ed25519", true, [ + "sign", + "verify", + ])) as CryptoKeyPair; + expect(publicKey.algorithm!.name).toBe("Ed25519"); + // @ts-ignore + expect(publicKey.algorithm!.namedCurve).toBe(undefined); + expect(privateKey.algorithm!.name).toBe("Ed25519"); + // @ts-ignore + expect(privateKey.algorithm!.namedCurve).toBe(undefined); + }); + }); +}); |