- Create multi-stage Dockerfile with node:20-alpine - Add .dockerignore for optimized build context - Create Kubernetes manifests (deployment, service, ingress, secret) - Add health check endpoint at /api/health - Configure next.config.ts with standalone output - Add comprehensive deployment documentation in README-DEPLOY.md Story: 4.1 - Criar Dockerfile e Manifests Kubernetes para Deploy 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
25 lines
720 B
TypeScript
25 lines
720 B
TypeScript
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);
|
|
});
|
|
});
|