Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
1.2 kB ยท 33 lines
TypeScript
12345678910111213141516171819202122232425262728293031323334import { expect } from "@std/expect";import { describe, it } from "@std/testing/bdd";
import { parseXVercelCache } from "./x-vercel-cache";
describe("parseXVercelCache", () => { for (const [value, expectedFragment] of [ ["MISS", "The response was not found in the edge cache"], ["HIT", "The response was served from the edge cache."], ["STALE", "A background request to the origin server"], ["PRERENDER", "The response was served from static storage."], ["REVALIDATED", "the cache was refreshed"], ]) { it(`describes the documented state ${value}`, () => { const result = parseXVercelCache(value); expect(result.value).toBe(value); expect(result.description).toContain(expectedFragment); }); }
it("matches states case-insensitively", () => { const lower = parseXVercelCache("revalidated"); const upper = parseXVercelCache("REVALIDATED"); expect(lower.description).toBe(upper.description); expect(lower.description).not.toBe("-"); });
it("falls back to '-' for an unknown value", () => { const result = parseXVercelCache("UNKNOWN"); expect(result.value).toBe("UNKNOWN"); expect(result.description).toBe("-"); });});