Files
the_order/services/finance/tests/finance.test.ts
defiQUG 3d43155312 feat: expand test coverage and configure comprehensive alerting
- 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
2025-11-13 10:04:32 -08:00

46 lines
1.0 KiB
TypeScript

import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import { FastifyInstance } from 'fastify';
import { createServer } from '../src/index';
describe('Finance 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('Payment Processing', () => {
it('should validate payment request schema', async () => {
const response = await server.inject({
method: 'POST',
url: '/api/v1/payments',
payload: {
// Invalid payload to test validation
},
});
expect(response.statusCode).toBe(400);
});
});
});