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:
yusufipk
2026-07-26 15:48:55 +07:00
parent 4eff54b0a6
commit e3fcbf30bf
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
"verify": "bun run check && bun run test",
"test:db:up": "podman compose -f docker-compose.test.yml up -d --wait postgres-test",
"test:db:down": "podman compose -f docker-compose.test.yml down -v",
"test:db:bootstrap": "bun run scripts/test-db-bootstrap.ts",
"test:db:bootstrap": "bun run tests/setup/db-bootstrap.ts",
"prepare": "husky",
"postinstall": "prisma generate",
"db:generate": "prisma generate",
@@ -6,11 +6,15 @@
* 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).
* which is documented at the top of db-global.ts).
*
* This lives under tests/ rather than scripts/ because the production image
* ignores tests/ entirely, and a script that imports from it would break the
* typecheck that runs before every build.
*
* Usage: bun run test:db:bootstrap
*/
import { setup } from '../tests/setup/db-global';
import { setup } from './db-global';
setup()
.then(() => {