23 lines
532 B
TypeScript
23 lines
532 B
TypeScript
import { describe, it, expect, beforeAll, afterAll } from "vitest";
|
|
import type { FastifyInstance } from "fastify";
|
|
import { createTestApp } from "./helpers.js";
|
|
|
|
let app: FastifyInstance;
|
|
|
|
beforeAll(async () => {
|
|
app = await createTestApp();
|
|
});
|
|
|
|
afterAll(async () => {
|
|
await app.close();
|
|
});
|
|
|
|
describe("GET /health", () => {
|
|
it("returns ok", async () => {
|
|
const res = await app.inject({ method: "GET", url: "/health" });
|
|
|
|
expect(res.statusCode).toBe(200);
|
|
expect(res.json()).toEqual({ status: "ok" });
|
|
});
|
|
});
|