File
Blob: tests/worker/routes/health.workers.test.ts
| 1 | import { describe, expect, it } from "vitest"; |
| 2 | import { apiRequest } from "@tests/worker/helpers/request"; |
| 3 | |
| 4 | describe("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 | }); |