import { describe, it, expect } from "vitest"; import { GET } from "./route"; describe("Health Check API", () => { it("deve retornar status 200 e JSON com status 'ok'", async () => { const response = await GET(); const data = await response.json(); expect(response.status).toBe(200); expect(data.status).toBe("ok"); }); it("deve retornar timestamp no formato ISO", async () => { const response = await GET(); const data = await response.json(); expect(data.timestamp).toBeDefined(); expect(typeof data.timestamp).toBe("string"); // Validar formato ISO 8601 const timestamp = new Date(data.timestamp); expect(timestamp.toISOString()).toBe(data.timestamp); }); });