1
0
Fork 0
polaris-task-force/vitest.setup.ts
Z8MB1E 8135c9850b feat(test): run tests against a dedicated truncated database
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>
2026-09-22 17:58:17 -04:00

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();