Skip to content
File

Blob: tests/worker/routes/health.workers.test.ts

typescript14 lines
1import { describe, expect, it } from "vitest";
2import { apiRequest } from "@tests/worker/helpers/request";
3 
4describe("GET /api/v1/health", () => {
5 it("returns status ok with a timestamp", async () => {
6 const res = await apiRequest("/api/v1/health");
7 
8 expect(res.status).toBe(200);
9 const body = (await res.json()) as { status: string; timestamp: string };
10 expect(body.status).toBe("ok");
11 expect(new Date(body.timestamp).toISOString()).toBe(body.timestamp);
12 });
13});