NODE_ENV=test PORT=3000 # Must point at a *different* database than your `.env`'s — `pnpm test` # (test-support/reset-db.ts's `resetDatabase()`) TRUNCATEs almost every # table before each test. Pointing this at the same database `pnpm dev` # uses will wipe real local data on every test run. Easiest setup: same # Postgres server/credentials as `.env`, just a different database name — # create it once with e.g.: # pnpm exec prisma db execute --url "postgresql://USER:PASSWORD@localhost:PORT/postgres?schema=public" --file - <<< "CREATE DATABASE batchcooking_test;" # DATABASE_URL="postgresql://USER:PASSWORD@localhost:PORT/batchcooking_test?schema=public" pnpm exec prisma migrate deploy DATABASE_URL="postgresql://changeme:changeme@localhost:5432/batchcooking_test?schema=public" # Required, no default on purpose — generate your own, e.g.: # node -e "console.log(require('crypto').randomBytes(48).toString('hex'))" JWT_SECRET=changeme-generate-a-real-random-secret-at-least-32-chars # Required — the Mocha suite exercises the real techStepClassifier, which # now round-trips over HTTP to services/tech-step-intent-service (no mocks # of internal services, per this repo's test conventions). Start that # service locally first (see its own README) with a matching # INTENT_SERVICE_SECRET, or every test touching tech-step-matcher.ts fails # with a connection error rather than a useful assertion failure. INTENT_SERVICE_BASE_URL=http://localhost:8000 INTENT_SERVICE_SECRET=changeme-generate-a-real-random-secret-at-least-32-chars # Optional — only needed to exercise tech-step-worker.routes.test.ts's # success path (a request with a matching secret); every other test runs # fine without it. Any value at least 32 chars works locally. # INTERNAL_WORKER_SECRET=changeme-generate-a-real-random-secret-at-least-32-chars