Integration Test Utils
Provides integration test helpers for a ready-to-use Payload instance in vitest.
Installation
pnpm add payload-integration-test-utils About
This plugin offers a set of opinionated integration test helpers specifically designed for testing Payload applications using vitest. It simplifies the process of setting up a local Payload instance connected to either a MongoDB or PostgreSQL database. Users can quickly create a global setup file to handle test initialization and teardown, ensuring a clean database state for each test. The core function, `getTestContextFor`, allows users to easily retrieve a Payload instance configured with their collections and globals, making it straightforward to write integration tests. Users can specify options to customize their test setup, including collection and global configurations. The plugin provides lifecycle hooks to manage test preparation and cleanup, with automatic handling of starting and stopping database containers through Testcontainers. This offers a streamlined approach to running integration tests without having to manually manage database instances.
Package info
- Package name
payload-integration-test-utils- Latest version
1.0.0- Unpacked size
- 12 kB
- License
- MIT
- Weekly downloads
- 1
- Last publish
- Mar 8, 2026
More from bhofstaetter
View profileSimilar plugins
More in DevtoolsOpenAPI
Autogenerate an OpenAPI specification from a Payload CMS instance and render it with Swagger UI, Redoc, RapiDoc, or Scalar.
Puck visual page builder
Integrate Puck visual page builder with Payload CMS for drag-and-drop editing.
Create Ideal CMS
Interactive CLI that scaffolds a production-ready Payload CMS monorepo preconfigured with FocusReactive plugins.
Dry Run
Test Payload create operations end-to-end without persisting, by rolling back the transaction after hooks and validation run.
OpenAPI
Generates OpenAPI specifications from Payload CMS configurations.