Integration Test Utils

Spins up a throwaway Payload instance on a test database container for integration tests

Community 0 6/wk MIT v1.0.0

Installation

pnpm add payload-integration-test-utils

About

Integration Test Utils gives each test file a working Payload instance backed by a real MongoDB or PostgreSQL database running in a disposable container. Tests call the Local API against your own collections and globals, so queries, hooks and access rules behave as they do in the running app.

Each test file starts with an empty database, and collection documents are cleared between tests, so one test cannot leak data into the next. The database container starts once per test run and is removed when the suite finishes. Generated TypeScript types can optionally be written to a file for typed test code.

Package info

Package name
payload-integration-test-utils
Latest version
1.0.0
Unpacked size
12 kB
License
MIT
Weekly downloads
6
Last publish
Mar 8, 2026

More from bhofstaetter

View profile

Type-safe factory functions that build Payload field configs with less boilerplate

Typed repository classes for collections and globals over the Payload Local API

Helpers for extracting IDs, resolving documents and composing field validators

Similar tools

More in Dev workflow

Stateful test emulator of the Payload collection REST API with seeded data

Editor support for Payload component paths, with import checks and autocomplete

Governance checks and ESLint rules for Payload project structure, access code and hooks

Manifest, linter and Payload block generator for a design system's components

Automated code transforms that move a Payload project past breaking changes

Idempotent seed runner that fills a Payload database with ordered, cross-referenced content