Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

relayJwt.test.ts

16 lines560 Bytes

1import { describe, expect, it } from "@effect/vitest";
2​
3import { RelayJwtError } from "./relayJwt.ts";
4​
5describe("relayJwt", () => {
6 it("extracts stable diagnostic codes without copying cause text into the error message", () => {
7 const error = new RelayJwtError({
8 operation: "verify",
9 typ: "test+jwt",
10 cause: { code: "ERR_JWT_EXPIRED", message: "sensitive library detail" },
11 });
12​
13 expect(RelayJwtError.diagnosticCode(error)).toBe("ERR_JWT_EXPIRED");
14 expect(error.message).not.toContain("sensitive library detail");
15 });
16});