Open-source status page, incident response and uptime monitoring
TypeScript alertingincident-managementmcpmcp-servermonitoringmonitoring-as-codeobservabilityon-callopen-sourcesrestatus-pagestatuspagesynthetic-monitoringterraformtinybirdtursouptimeuptime-checkeruptime-monitor
import "../test-preload.ts";
import { describe, expect, test } from "vitest";
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();
});
});