Repository navigation
2.1.0 (2026-11-14)
Vitest 5 is now supported, you can bring your own Prisma client, and clientPath works with TypeScript clients. This release requires Node.js 22 or newer.
✨ New Features
- Bring your own Prisma client (#51). The new
vitest-environment-prisma-postgres/hooksentry exportssetupPrismaPostgres(createClient, transactionOptions?). Call it in a setup file to wrap every test in a rolled-back transaction while you keep your own Vitest environment (node,jsdom, ...). Your factory builds the client, so Prisma extensions and custom adapter settings work. See Use your own Prisma client and Vitest environment. - Vitest 5 support. The
vitestpeer range is now>=4.1 <6(#48, closes #47).
🐛 Bug Fixes
clientPathloads withimport()(#53, #54, fixes #22). File paths now resolve against the working directory, not the package'sdist/folder. Directories and paths without an extension still resolve to their entry file. TypeScript clients from Prisma 7'sprisma-clientgenerator load on Node.js 22.18+ in an ESM package ("type": "module") if the generator setsimportFileExtension = "ts". Package names such as@prisma/clientresolve as before. Thanks to @tywenk for the report and the original fix in #32.- Static client metadata works outside test transactions (#52). Reading
_runtimeDataModelon the client no longer throws before the first test starts. This fixes libraries that read it at import time, such as better-auth 1.7's Prisma adapter.
⚠️ Node.js 22 or newer
- Node.js 20 reached end of life in April 2026, so
engines.nodeis now>=22. CI tests Node.js 22, 24 and 26 (#53). npm only warns aboutenginesby default, but Node 20 is no longer tested.
📦 Dependencies
- Built with TypeScript 7, Vitest 5 and tsup 9. Peer ranges for
prismaand@prisma/adapter-pgare unchanged. - Test coverage is at 100% and CI enforces it.