...
Install Bun ^1.4.0, matching the @types/bun range. bun run test needs that runtime.
bun --versionCreate the database:
docker compose up -dDelete the database:
docker compose down -vPrerequisites and order for the full-stack E2E tests:
-
Install Bun
^1.4.0and Playwright Chromium:bunx playwright install chromium
-
Start local PostgreSQL and use this exact database URL:
docker compose up -d # DATABASE_URL=postgresql://ben:password@localhost:5432/rankovo-dev -
For a fresh database, apply the schema once:
bun run db:push
-
Set
ALLOW_DEV_LOGIN=truein.env.local, prepare the database, and run E2E tests:bun run test:e2e:prepare bun run test:e2e
bun run test:e2e:prepare seeds the database and creates the development login accounts. bun run test:e2e starts Next dev on port 3001 and runs Playwright Chromium tests; it does not seed the database by itself. Your normal bun run dev server can continue using port 3000.
bun run test # Bun unit tests
bun run test:e2e # Playwright end-to-end tests (prepare the database first)
bun run test:all # Run unit and end-to-end tests (prepare the database first)bun run test:e2e:prepare deletes and recreates the local seed data, then
creates the development login accounts. Use it only with the disposable test
database shown above. bun run test:all does not prepare or reset the database.
- Transform search param keys with kebab-case & CamelCase