16 lines
682 B
TypeScript
16 lines
682 B
TypeScript
/**
|
||
* 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;
|