diff --git a/backend/tests/integration/health.test.ts b/backend/tests/integration/health.test.ts new file mode 100644 index 0000000..4d9d4ad --- /dev/null +++ b/backend/tests/integration/health.test.ts @@ -0,0 +1,29 @@ +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', + }); + }); +});