What problem does it solve?
This Skill documents reliable integration testing patterns for Bun-based HTTP servers to validate full endpoint flows, authorization rules, error responses, and database interactions across test files.
Core Features & Use Cases
- Isolated server setup using Bun.serve with a unique port per test file to avoid port collisions.
- Test data and identity patterns including unique email generation, multiple user roles (owner, member, outsider), token generation, and role seeding via upsert.
- HTTP response and authorization assertions, error case checks, nested describe organization for related flows, and ordered cleanup to respect foreign key constraints.
- Use Case: validate user registration, authenticated resource creation, authorization denial, password reset flows, and end-to-end cleanup in a repeatable CI-friendly way.
Quick Start
Start an isolated Bun.serve test server on a unique port, seed roles and test users, generate access tokens, and run the integration tests against your API endpoints.