Something went wrong. Try again.
Something went wrong. Try again.
1234567891011121314151617181920212223import assert from "node:assert/strict";import test from "node:test";
import { buildApp } from "./api.ts";import type { Config } from "../config.ts";import type { OpenMeetClient } from "../openmeet/openmeet.ts";
// Only the health route is under test; the injected client stands in for the// network so no request ever leaves the process.const cfg = {} as Config;const client: OpenMeetClient = { getUpcomingEvents: async () => [] };
test("GET /health reports ok", async () => { const app = await buildApp(cfg, { omClient: client, logger: false }); try { const res = await app.inject({ method: "GET", url: "/health" }); assert.equal(res.statusCode, 200); assert.deepEqual(res.json(), { status: "ok" }); } finally { await app.close(); }});