Environment Spin-Up
Run before every test validation. Full restart each time.
docker compose down && docker compose up -d
until docker compose exec db pg_isready -U postgres 2>/dev/null; do sleep 1; done
docker compose exec db psql -U postgres -c "CREATE DATABASE bricktrack;" 2>/dev/null || true
npx drizzle-kit push
npm run test:unit
npm run test:e2e
Key Details
- Playwright auto-starts dev server via
webServerconfig inplaywright.config.ts .env.localDATABASE_URL must point tobricktrackdatabase (notproperty_tracker)- E2E requires:
BETTER_AUTH_SECRET,E2E_CLERK_USER_EMAIL,E2E_CLERK_USER_PASSWORDin.env.local - DB runs via Docker Compose with
pgvector/pg16 - Must manually create
bricktrackdb after fresh container (theCREATE DATABASEcommand above handles this)