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.
TypeScript
at apifix
12345678910111213141516171819202122232425262728293031323334// Mutable per-test config shared by the slack module doubles below. Replaces// the per-file bun `mock.module` closures (handler.test / interactions.test):// each test sets the fields it needs in beforeEach and reads `calls`.type SlackCall = { method: string; args: Record<string, unknown> };type Override = ((args: Record<string, unknown>) => Promise<unknown>) | null;
export interface SlackTestState { resolveWorkspace: (teamId: string) => Promise<unknown>; calls: SlackCall[]; postMessageOverride: Override; updateOverride: Override; postEphemeralOverride: Override; runAgentOverride: (() => Promise<unknown>) | null; repliesImpl: () => Promise<unknown>;}
const g = globalThis as Record<string, unknown>;if (!g.__slackTestState) { g.__slackTestState = { resolveWorkspace: () => Promise.resolve(null), calls: [], postMessageOverride: null, updateOverride: null, postEphemeralOverride: null, runAgentOverride: null, repliesImpl: () => Promise.resolve({ messages: [{ user: "U1", text: "test message", ts: "1.1" }], }), } satisfies SlackTestState;}
export const slackTestState = g.__slackTestState as SlackTestState;