import { describe, it, expect, beforeAll, afterAll } from 'vitest'; import { buildApp } from '../../src/app.js'; describe('Fastify server integration', () => { let app: ReturnType; beforeAll(async () => { app = buildApp(); await app.ready(); }); afterAll(async () => { await app.close(); }); it('should return a basic health/status payload', async () => { const response = await app.inject({ method: 'GET', url: '/health', }); expect(response.statusCode).toBe(200); const body = JSON.parse(response.body); expect(body).toEqual({ status: 'ok', database: 'connected', }); }); });