{"library":"prisma-test-utils","title":"Prisma Test Utils","description":"A testing utility library for Prisma (formerly Prisma 2) that generates seed data and database pool management based on your Prisma schema. Version 0.4.1 (latest) is the current stable release, with sparse updates since 2020. The project is temporarily unmaintained as noted in the README. Key features include automatic seed data generation with customizable factories, isolated per-test databases via connection pooling, and full TypeScript type safety. Differentiates from manual seeding by being data-model agnostic and automatically adapting to schema changes. Requires peer dependencies @prisma/client, @prisma/lift, and prisma2, though these are now outdated as Prisma has evolved significantly (Prisma 4+).","language":"javascript","status":"deprecated","last_verified":"Fri May 01","install":{"commands":["npm install prisma-test-utils"],"cli":null},"imports":["import seed from '@generated/prisma-test-utils/seed'","import SQLitePool from '@generated/prisma-test-utils'","import { Pool } from '@generated/prisma-test-utils'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// schema.prisma\ngenerator testutils {\n  provider = \"prisma-test-utils\"\n  output   = \"node_modules/@generated/prisma-test-utils\"\n}\n\n// test.ts\nimport Photon from '@generated/photon'\nimport seed from '@generated/prisma-test-utils/seed'\n\nasync function run() {\n  const client = new Photon({ datasources: { db: { url: 'file:./dev.db' } } })\n  await seed(client, bag => ({\n    Post: {\n      amount: 10,\n      factory: {\n        title: bag.faker.sentence,\n        published: true,\n      },\n    },\n  }))\n  const posts = await client.posts.findMany()\n  console.log(posts.length) // 10\n  await client.$disconnect()\n}\nrun().catch(console.error)","lang":"typescript","description":"Configures the generator, seeds 10 Post records with faker-generated titles, and queries them using the Prisma client.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}