17 lines
523 B
TypeScript
17 lines
523 B
TypeScript
import { describe, it, expect } from "vitest";
|
|
import express from "express";
|
|
import request from "supertest";
|
|
import { healthRoutes } from "../routes/health.js";
|
|
import { serverVersion } from "../version.js";
|
|
|
|
describe("GET /health", () => {
|
|
const app = express();
|
|
app.use("/health", healthRoutes());
|
|
|
|
it("returns 200 with status ok", async () => {
|
|
const res = await request(app).get("/health");
|
|
expect(res.status).toBe(200);
|
|
expect(res.body).toEqual({ status: "ok", version: serverVersion });
|
|
});
|
|
});
|