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
- Last publish
- Mar 8, 2026
More from bhofstaetter
View profileSimilar plugins
More in Devtoolspayload-cli
CLI for direct access to PayloadCMS data for AI agents and humans.
agent API guide
Generate a live API reference and query guide for Payload CMS.
Markdown documentation sync
Syncs Markdown documentation with Payload CMS using Git.
OpenAPI
Generates OpenAPI specifications from Payload CMS configurations.
Puck visual page builder
Integrate Puck visual page builder with Payload CMS for drag-and-drop editing.
Dry Run
Test Payload create operations end-to-end without persisting, by rolling back the transaction after hooks and validation run.