api-testing
Installation
SKILL.md
API Integration Testing
Build robust test suites for your APIs with integration, contract, and E2E tests.
Testing Pyramid for APIs
| Level | What It Tests | Speed | Isolation |
|---|---|---|---|
| Unit | Handlers, validators, utils | Fast | High |
| Integration | API + database, services | Medium | Medium |
| Contract | API shape vs OpenAPI spec | Fast | High |
| E2E | Full stack, real DB | Slow | Low |
Key Principles
- Test API behavior through HTTP requests, not internal function calls
- Use real database for integration tests (SQLite or test containers)
- Validate response shapes against OpenAPI spec with contract tests
- Isolate external services with MSW or similar mock servers