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:
@@ -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',
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user