Files
Cibello-app/apps/api/test/setup-env.ts
T

16 lines
682 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Hermetic test environment for API integration tests.
* Must run BEFORE any application module is imported so that `loadConfig`
* sees deterministic values instead of whatever happens to be in `.env`.
*/
process.env.NODE_ENV = "test";
process.env.AAMOS_MODE = "mock";
process.env.EMAIL_MODE = "log";
process.env.S3_MODE = "mock";
process.env.LOG_LEVEL = "error";
// Local test database fallback tests still need a Postgres instance, but
// the connection string is not a secret and the value is predictable.
process.env.TEST_DATABASE_URL ||= "postgres://app_user:app_dev_password@localhost:5432/cibello_test";
process.env.DATABASE_URL = process.env.TEST_DATABASE_URL;