mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 17:46:06 +00:00
fix(build): move the test db bootstrap under tests/
`.dockerignore` excludes `tests`, so the production build context carries scripts/test-db-bootstrap.ts without the tests/setup/db-global module it imports. tsconfig includes `**/*.ts`, so the `prebuild` typecheck fails on the missing module and every deploy since the test suites landed has died there. CI never saw it because tests/ exists on a runner. The script is test-only, so it belongs in the tree that is already ignored.
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
/**
|
||||
* 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);
|
||||
});
|
||||
Reference in New Issue
Block a user