import { describe, it, expect, beforeAll, afterAll } from 'bun:test' import type { FastifyInstance } from 'fastify' import { createTestApp } from '../../../src/test/helpers.js' describe('GET /v1/health', () => { let app: FastifyInstance beforeAll(async () => { app = await createTestApp() }) afterAll(async () => { await app.close() }) it('returns ok when db and redis are connected', async () => { const response = await app.inject({ method: 'GET', url: '/v1/health', }) expect(response.statusCode).toBe(200) const body = response.json() expect(body.status).toBe('ok') expect(body.db).toBe('connected') expect(body.redis).toBe('connected') expect(body.timestamp).toBeDefined() }) })