- Add unit tests for all core services (identity, intake, finance, dataroom) - Create integration test framework with shared setup utilities - Add E2E test suite for complete user workflows - Add test utilities package (server factory) - Configure Prometheus alert rules (service health, infrastructure, database, Azure) - Add alert rules ConfigMap for Kubernetes - Update Prometheus deployment with alert rules - Fix tsconfig.json to include test files - Add tests/tsconfig.json for integration/E2E tests - Fix server-factory.ts linting issues
46 lines
1.0 KiB
TypeScript
46 lines
1.0 KiB
TypeScript
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
import { FastifyInstance } from 'fastify';
|
|
import { createServer } from '../src/index';
|
|
|
|
describe('Dataroom Service', () => {
|
|
let server: FastifyInstance;
|
|
|
|
beforeEach(async () => {
|
|
server = await createServer();
|
|
await server.ready();
|
|
});
|
|
|
|
afterEach(async () => {
|
|
await server.close();
|
|
});
|
|
|
|
describe('Health Check', () => {
|
|
it('should return 200 on health check', async () => {
|
|
const response = await server.inject({
|
|
method: 'GET',
|
|
url: '/health',
|
|
});
|
|
|
|
expect(response.statusCode).toBe(200);
|
|
expect(response.json()).toMatchObject({
|
|
status: 'ok',
|
|
});
|
|
});
|
|
});
|
|
|
|
describe('Deal Management', () => {
|
|
it('should validate deal creation request', async () => {
|
|
const response = await server.inject({
|
|
method: 'POST',
|
|
url: '/api/v1/deals',
|
|
payload: {
|
|
// Invalid payload to test validation
|
|
},
|
|
});
|
|
|
|
expect(response.statusCode).toBe(400);
|
|
});
|
|
});
|
|
});
|
|
|