Bootstrap a per-run test database (ensure, push schema, truncate, seed baselines, repair sequences), wire vitest/playwright globals, and gate schema push behind DB_PUSH. Serial test files share the one database. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
11 lines
417 B
TypeScript
11 lines
417 B
TypeScript
// Any setup scripts you might need go here
|
|
|
|
// Load .env files
|
|
import "dotenv/config";
|
|
|
|
import { resolveTestDatabaseUri } from "./tests/test-db";
|
|
|
|
// Tests never touch the development database: every payload connection in the
|
|
// test process targets the dedicated test database (see tests/test-db.ts).
|
|
// Must run before any test file imports the Payload config.
|
|
process.env.DATABASE_URI = resolveTestDatabaseUri();
|