27 lines
785 B
TypeScript
27 lines
785 B
TypeScript
// Jest test setup file
|
|
import { jest } from '@jest/globals';
|
|
import { LoggingService } from '../src/Application/Services/LoggingService';
|
|
|
|
// Mock environment variables
|
|
process.env.NODE_ENV = 'test';
|
|
process.env.JWT_SECRET = 'test-jwt-secret';
|
|
process.env.EMAIL_HOST = 'test.smtp.com';
|
|
process.env.EMAIL_PORT = '587';
|
|
process.env.EMAIL_USER = 'test@example.com';
|
|
process.env.EMAIL_PASS = 'testpass';
|
|
process.env.EMAIL_FROM = 'test@example.com';
|
|
process.env.APP_BASE_URL = 'http://localhost:3000';
|
|
|
|
// Global test timeout
|
|
jest.setTimeout(10000);
|
|
|
|
// Global cleanup to prevent Jest from hanging
|
|
afterAll(async () => {
|
|
try {
|
|
await LoggingService.getInstance().shutdown();
|
|
} catch (error) {
|
|
// Ignore cleanup errors in tests
|
|
console.log('Test cleanup completed');
|
|
}
|
|
});
|