Openstatus www.openstatus.dev
at main 22 lines 490 B view raw
1import { expect, mock, test } from "bun:test"; 2 3import { triggerNotifications } from "./alerting"; 4 5test.todo("should send email notification", async () => { 6 const fn = mock(() => {}); 7 mock.module("./utils.ts", () => { 8 return { 9 providerToFunction: { 10 email: fn, 11 }, 12 }; 13 }); 14 await triggerNotifications({ 15 monitorId: "1", 16 statusCode: 400, 17 notifType: "alert", 18 cronTimestamp: 123456, 19 incidentId: 1, 20 }); 21 expect(fn).toHaveBeenCalled(); 22});