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.4 kB ยท 38 lines
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839import "../test-preload.ts";import { expect } from "@std/expect";import { describe, test } from "@std/testing/bdd";
import { getChannel } from "./index";
describe("getChannel", () => { test('returns email channel for "email"', () => { const channel = getChannel("email"); expect(channel).not.toBeNull(); expect(channel?.id).toBe("email"); expect(typeof channel?.sendNotifications).toBe("function"); expect(typeof channel?.sendVerification).toBe("function"); expect(typeof channel?.validateConfig).toBe("function"); });
test('returns webhook channel for "webhook"', () => { const channel = getChannel("webhook"); expect(channel).not.toBeNull(); expect(channel?.id).toBe("webhook"); expect(typeof channel?.sendNotifications).toBe("function"); expect(typeof channel?.sendVerification).toBe("function"); expect(typeof channel?.validateConfig).toBe("function"); });
test('returns slack channel for "slack"', () => { const channel = getChannel("slack"); expect(channel).not.toBeNull(); expect(channel?.id).toBe("slack"); expect(typeof channel?.sendNotifications).toBe("function"); expect(typeof channel?.validateConfig).toBe("function"); });
test("returns null for unknown channel types", () => { expect(getChannel("sms")).toBeNull(); expect(getChannel("")).toBeNull(); });});