first commit

This commit is contained in:
2026-08-14 17:35:24 -03:00
commit 04472fcd2b
118 changed files with 19173 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
import { INestApplication } from '@nestjs/common';
import { Test, TestingModule } from '@nestjs/testing';
import request, { Response } from 'supertest';
import { AppModule } from '../src/app.module';
import { HealthStatus } from '../src/modules/health/health.service';
describe('HealthController (e2e)', () => {
let app: INestApplication;
beforeAll(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();
app = moduleFixture.createNestApplication();
await app.init();
});
afterAll(async () => {
await app.close();
});
it('GET /health retorna 200 com status da API e do banco', () => {
return request(app.getHttpServer() as Parameters<typeof request>[0])
.get('/health')
.expect(200)
.expect((res: Response) => {
const body = res.body as HealthStatus;
expect(body.status).toBeDefined();
expect(body.database).toBeDefined();
expect(body.timestamp).toBeDefined();
});
});
});