Files
arsam 0535caf9be Import tests: backend/tests/integration/health
Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
2026-09-18 23:09:45 +03:30

30 lines
674 B
TypeScript

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',
});
});
});