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
- 2
- Last publish
- Mar 8, 2026
More from bhofstaetter
View profileLexical Rich Text Editor
Adds a lexical-based rich text editor to Payload CMS.
Text Color Leaf for Slate Editor
Adds a text color picker to the SlateJS editor in Payload.
Visual Editor
Adds a visual live editor to Payload CMS for instant content preview.
Extended lexical editor features
Adds advanced features to the Payload CMS Lexical editor.
Shiki Code
Integrates Shiki syntax highlighting for code blocks in Payload CMS.
Callouts
Create styled callout blocks with customizable themes for Payload CMS.