import { INestApplication } from '@nestjs/common'; import request from 'supertest'; import { App } from 'supertest/types'; import { createTestApp } from './utils/create-test-app'; describe('Health (e2e)', () => { let app: INestApplication; beforeAll(async () => { app = await createTestApp(); }); afterAll(async () => { await app.close(); }); it('GET /health returns ok without auth', () => { return request(app.getHttpServer()) .get('/health') .expect(200) .expect({ status: 'ok' }); }); it('GET /health/ready returns ok when the database is reachable', () => { return request(app.getHttpServer()) .get('/health/ready') .expect(200) .expect({ status: 'ok' }); }); });