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.
735 B ยท 22 lines
TypeScript
1234567891011121314151617181920212223import { describe, expect, it } from "vitest";
import { getMonitorHealth } from "./monitors.client";
describe("getMonitorHealth", () => { it("follows the last check while active", () => { expect(getMonitorHealth({ active: true, status: "active" })).toBe("active"); expect(getMonitorHealth({ active: true, status: "error" })).toBe("error"); expect(getMonitorHealth({ active: true, status: "degraded" })).toBe( "degraded", ); });
it("reads as inactive when paused, whatever the last check said", () => { expect(getMonitorHealth({ active: false, status: "error" })).toBe( "inactive", ); expect(getMonitorHealth({ active: null, status: "active" })).toBe( "inactive", ); });});