|
- import { describe, it, expect, beforeAll, afterAll } from 'vitest';
- import { createServer } from '../src/server';
- import { addHealthRoutes, addSummaryRoutes } from '../src/routes';
- import { FastifyInstance } from 'fastify';
-
- describe('Example', () => {
- let server: FastifyInstance;
-
- beforeAll(() => {
- server = createServer();
- addHealthRoutes(server);
- addSummaryRoutes(server);
- });
-
- afterAll(async () => {
- await server.close();
- });
-
- it('should have the expected content', async () => {
- const response = await server
- .inject()
- .get('/api/health/live')
- .headers({
- Accept: 'application/json',
- });
- expect(response.statusCode).toBe(200);
- });
- });
|