v3.0.0 makes Neon Testing runner-aware, with explicit entry points for Vitest, Bun Test, shared utilities, setup, and custom runners.
What's new
- Added first-class Bun Test support via
neon-testing/bun. - Added explicit entry points:
neon-testing/vitestneon-testing/bunneon-testing/coreneon-testing/setupneon-testing/utils
- Added runner-registered
DATABASE_URLsafeguarding throughneon-testing/setup, replacing the Vitest/Vite plugin. - Added runner-agnostic core support for custom test runners by passing lifecycle hooks manually.
- Expanded coverage across Vitest and Bun, including Neon serverless,
pg, Postgres.js, Drizzle, pooled and direct connections, HTTP, TCP, and WebSocket usage.
Breaking changes
- The root import has been removed. Use the Vitest entry point instead:
// v2
import { makeNeonTesting } from "neon-testing";
// v3
import { makeNeonTesting } from "neon-testing/vitest";- The Vite plugin entry point has been removed. Register
neon-testing/setupdirectly with your test runner. neon-testing/utilsno longer re-exports the deprecated Vite plugin helper.lazySingletonandcreateBarrierremain available.- Type names changed: factory options are now
MakeNeonTestingOptions, and per-file overrides are nowNeonTestingOptions. - The minimum Node.js version is now
>=22.
Upgrading from v2
Most Vitest projects need three changes:
- Change imports from
neon-testingtoneon-testing/vitest. - Remove the old Vite plugin usage, if present.
- Add
neon-testing/setupto VitestsetupFiles.
// vitest.config.ts
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
setupFiles: ["neon-testing/setup"],
},
});Full Changelog: v2.7.0...v3.0.0