home / skills / andrelandgraf / fullstackrecipes / integration-tests
This skill helps you run fast, reliable integration tests by importing API handlers with Bun's test runner to eliminate HTTP overhead.
npx playbooks add skill andrelandgraf/fullstackrecipes --skill integration-testsReview the files below or copy the command above to add this skill to your agents.
---
name: integration-tests
description: Test API routes by importing handlers directly with Bun's test runner. Fast, reliable tests without HTTP overhead.
---
# Integration Tests
To set up Integration Tests, refer to the fullstackrecipes MCP server resource:
**Resource URI:** `recipe://fullstackrecipes.com/integration-tests`
If the MCP server is not configured, fetch the recipe directly:
```bash
curl -H "Accept: text/plain" https://fullstackrecipes.com/api/recipes/integration-tests
```
This skill provides a pattern for fast, reliable integration tests by importing API route handlers directly into Bun’s test runner. It removes HTTP overhead so tests execute quickly and deterministically. It is geared toward TypeScript full-stack apps and pairs well with production-ready patterns and recipes.
You import route handler functions or controller modules directly into Bun test files and invoke them with mocked request and context objects. Tests run inside Bun’s test runner, avoiding network layers and enabling precise assertions on responses, status codes, and side effects. The recipe includes examples and setup steps to integrate with existing server code and test helpers.
Do I lose coverage for transport-level behavior?
You focus coverage on handler logic; keep a small set of separate end-to-end tests for transport-level behavior if needed.
Can I run these tests alongside Bun’s standard test suite?
Yes — Bun’s test runner executes TypeScript tests directly and integrates naturally with this pattern.
How do I get the full recipe and examples?
Refer to the integration-tests recipe in the fullstackrecipes collection or fetch it directly from the site for step-by-step setup.