Skip to content

v3.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 17 Jun 17:34

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/vitest
    • neon-testing/bun
    • neon-testing/core
    • neon-testing/setup
    • neon-testing/utils
  • Added runner-registered DATABASE_URL safeguarding through neon-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/setup directly with your test runner.
  • neon-testing/utils no longer re-exports the deprecated Vite plugin helper. lazySingleton and createBarrier remain available.
  • Type names changed: factory options are now MakeNeonTestingOptions, and per-file overrides are now NeonTestingOptions.
  • The minimum Node.js version is now >=22.

Upgrading from v2

Most Vitest projects need three changes:

  1. Change imports from neon-testing to neon-testing/vitest.
  2. Remove the old Vite plugin usage, if present.
  3. Add neon-testing/setup to Vitest setupFiles.
// vitest.config.ts
import { defineConfig } from "vitest/config";

export default defineConfig({
  test: {
    setupFiles: ["neon-testing/setup"],
  },
});

Full Changelog: v2.7.0...v3.0.0