/** * Builds the test database schema outside of Vitest. * * The `api` Vitest project gets this for free through its globalSetup, but the * end-to-end suite runs the real app against the same database and needs the * schema in place before the server starts. Both paths therefore call the same * setup function, so there is exactly one description of how a test database is * built (including why it uses `prisma db push` rather than `migrate deploy`, * which is documented at the top of tests/setup/db-global.ts). * * Usage: bun run test:db:bootstrap */ import { setup } from '../tests/setup/db-global'; setup() .then(() => { console.log('Test database schema is ready'); }) .catch((error: unknown) => { console.error(error instanceof Error ? error.message : error); process.exit(1); });