From 0535caf9be1faf0fd81c0c1c46a9826fe9ee52c5 Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:09:45 +0330 Subject: [PATCH] Import tests: backend/tests/integration/health Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- backend/tests/integration/health.test.ts | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 backend/tests/integration/health.test.ts 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', + }); + }); +});