#Multiple .env files solution with Prisma
5 messages · Page 1 of 1 (latest)
"test:e2e": "pnpm run test:setup && dotenv -e .env.test -- jest --config ./test/jest-e2e.json && pnpm run test:cleanup",
that's the way I do it, I use dotenv to load .env.test which has a DATABASE_URL that points to a different port than the one of .env.local I use in dev
test:setup runs a postgres database with docker compose
"test:setup": "docker compose up test-database --wait && dotenv -e .env.test -- prisma migrate deploy && prisma generate",
there's test:setup for info
runs fine in a pre-commit hook, and in my CI