33 lines
895 B
TypeScript
33 lines
895 B
TypeScript
|
|
import 'reflect-metadata'
|
||
|
|
|
||
|
|
/**
|
||
|
|
* E2E Test Setup
|
||
|
|
*
|
||
|
|
* Sets environment variables for Docker test services.
|
||
|
|
* Run docker-compose up before running E2E tests.
|
||
|
|
*/
|
||
|
|
|
||
|
|
// Set test environment
|
||
|
|
process.env.NODE_ENV = "test";
|
||
|
|
|
||
|
|
// Redis - Test instance on port 26380
|
||
|
|
process.env.DATABASE_REDIS_HOST = "localhost";
|
||
|
|
process.env.DATABASE_REDIS_PORT = "26380";
|
||
|
|
|
||
|
|
// PostgreSQL - Test instance on port 25433
|
||
|
|
process.env.DATABASE_URL =
|
||
|
|
"postgresql://postgres:postgres@localhost:25433/lilith_sso_test";
|
||
|
|
|
||
|
|
// Session configuration
|
||
|
|
process.env.SESSION_TTL = "604800000"; // 7 days in ms
|
||
|
|
|
||
|
|
// MFA encryption key (32 chars for AES-256)
|
||
|
|
process.env.MFA_ENCRYPTION_KEY = "test-encryption-key-32-chars-xx";
|
||
|
|
|
||
|
|
// Email service (mock URL for tests)
|
||
|
|
process.env.EMAIL_SERVICE_URL = "http://localhost:3002";
|
||
|
|
|
||
|
|
// JWT configuration
|
||
|
|
process.env.JWT_SECRET = "test-jwt-secret-for-e2e-tests";
|
||
|
|
process.env.JWT_EXPIRATION = "1h";
|