import { describe, expect, it } from 'vitest'; import { buildApp } from '../src/app.js'; import { loadConfig } from '../src/config.js'; describe('GET /healthz', () => { it('returns 200 with status ok', async () => { const config = loadConfig({ NODE_ENV: 'test', LOG_LEVEL: 'fatal' }); const app = await buildApp({ config }); try { const res = await app.inject({ method: 'GET', url: '/healthz' }); expect(res.statusCode).toBe(200); const body = res.json() as { status: string; uptime: number }; expect(body.status).toBe('ok'); expect(typeof body.uptime).toBe('number'); } finally { await app.close(); } }); });