Import tests: backend/tests/integration/health

Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
This commit is contained in:
arsam
2026-09-18 23:09:45 +03:30
parent f2c5b8ffa1
commit 0535caf9be
+29
View File
@@ -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<typeof buildApp>;
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',
});
});
});