mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 06:43:06 +00:00
Staff surfaces share one Cenário control; leaders keep a single declaredVotes value. Unlocks E8.
16 lines
719 B
TypeScript
16 lines
719 B
TypeScript
// Load the isolated test environment — NEVER .env / .env.local, which point at
|
|
// the production database. `override: true` guarantees the test database wins
|
|
// even if a prod DATABASE_URL is already exported in the shell.
|
|
import { config as loadEnv } from 'dotenv'
|
|
|
|
import { assertTestDatabase } from './tests/helpers/assertTestDatabase'
|
|
|
|
loadEnv({ path: '.env.test', override: true })
|
|
|
|
// Optional local override when the default Docker port is occupied (e.g. mapped to 5433).
|
|
if (process.env.TEQO_TEST_DATABASE_URL) {
|
|
process.env.DATABASE_URL = process.env.TEQO_TEST_DATABASE_URL
|
|
}
|
|
|
|
// Fail closed: refuse to run the (destructive) suite against a non-test database.
|
|
assertTestDatabase(process.env.DATABASE_URL)
|