Example integration testing with Prisma, Supabase, Postgres.
- Node 16
- Docker
Start database:
npx supabase start
npx prisma db push
npx prisma studio
Call service:
npx ts-node src/service.ts
Run integration tests:
npm run test-e2e
At the high-level the integration tests:
- Start supabase locally in Docker
- Local a
DATABASE_URLenvironment variable for.env.testusing dotenv-cli - Run
prisma db pushagainst local supabase to create tables based on schema - Run integrations tests with Jest against local database. Records are deleted after each test.