Open-source status page, incident response and uptime monitoring
TypeScript alertingincident-managementmcpmcp-servermonitoringmonitoring-as-codeobservabilityon-callopen-sourcesrestatus-pagestatuspagesynthetic-monitoringterraformtinybirdtursouptimeuptime-checkeruptime-monitor
import { describe, expect, it } from "vitest";
import { lenientEnum } from "./schemas";
describe("lenientEnum", () => {
const schema = lenientEnum(["a", "b"]);
it("keeps known values", () => {
expect(schema.parse("a")).toBe("a");
});
it("parses unknown strings to unknown", () => {
expect(schema.parse("brand_new_status")).toBe("unknown");
});
it("still rejects non-strings", () => {
expect(() => schema.parse(42)).toThrow();
});
});