34 lines
1.4 KiB
TypeScript
34 lines
1.4 KiB
TypeScript
// Shared constants for the e2e harness. The database is a DISPOSABLE Docker container —
|
|||
|
|
// these tests must never point at a real database. global-setup.ts creates/destroys the
|
||
|
|
// container; auth.e2e.test.ts refuses to run unless DATABASE_URL matches this URL exactly.
|
||
|
|
|
||
|
|
export const E2E_CONTAINER = 'elegal-e2e-pg';
|
||
|
|
export const E2E_DB_PORT = 54329;
|
||
|
|
export const E2E_DB_NAME = 'elegal_e2e';
|
||
|
|
export const E2E_DB_PASSWORD = 'e2e_throwaway_password';
|
||
|
|
|
||
|
|
export const E2E_DATABASE_URL = `postgres://postgres:${E2E_DB_PASSWORD}@127.0.0.1:${E2E_DB_PORT}/${E2E_DB_NAME}`;
|
||
|
|
|
||
|
|
export const E2E_ENV: Record<string, string> = {
|
||
|
|
NODE_ENV: 'test',
|
||
|
|
DATABASE_URL: E2E_DATABASE_URL,
|
||
|
|
DATABASE_SSL: 'disable',
|
||
|
|
DATABASE_CA_CERT_PATH: '',
|
||
|
|
PUBLIC_URL: 'http://localhost:8080',
|
||
|
|
COOKIE_DOMAIN: '',
|
||
|
|
SESSION_SECRET: 'e2e-session-secret-not-real-0123456789abcdef',
|
||
|
|
CSRF_SECRET: 'e2e-csrf-secret-not-real-0123456789abcdef',
|
||
|
|
SUPERADMIN_EMAILS: 'superadmin-e2e@example.com',
|
||
|
|
// Dummy Spaces config — env.ts requires these; no storage calls happen in auth tests.
|
||
|
|
SPACES_ENDPOINT: 'https://e2e-invalid.example.com',
|
||
|
|
SPACES_REGION: 'e2e',
|
||
|
|
SPACES_BUCKET: 'e2e-bucket',
|
||
|
|
SPACES_KEY: 'e2e-key',
|
||
|
|
SPACES_SECRET: 'e2e-secret',
|
||
|
|
// Empty → email sends are skipped, Stripe/Sentry stay inert.
|
||
|
|
SMTP2GO_API_KEY: '',
|
||
|
|
STRIPE_SECRET_KEY: '',
|
||
|
|
STRIPE_WEBHOOK_SECRET: '',
|
||
|
|
SENTRY_DSN_API: '',
|
||
|
|
};
|