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>
12 lines
449 B
TypeScript
12 lines
449 B
TypeScript
import { getPayload } from "payload";
|
|
import config from "@payload-config";
|
|
|
|
/**
|
|
* One-shot schema push for the test database. Run with DB_PUSH=1 and
|
|
* DATABASE_URI pointing at the test database (tests/test-db.ts does this);
|
|
* initializing the Payload adapter with push: true makes drizzle create or
|
|
* diff the full schema. Exits immediately after initialization.
|
|
*/
|
|
const payload = await getPayload({ config });
|
|
void payload;
|
|
process.exit(0);
|