api-test
БесплатноБез исполняемых скриптовНе проверенTest API endpoints with automated test generation
от diegosouzapw★ 68 звёзд на GitHubОб этом скилле
API Test Generator
Generate comprehensive API tests for the specified endpoint.
Target
$ARGUMENTS
Test Strategy for Solo Developers
Create practical, maintainable tests using modern tools:
1. Testing Approach
- Unit tests for validation logic
- Integration tests for full API flow
- Edge case coverage
- Error scenario testing
2. Tools (choose based on project)
- Vitest - Fast, modern (recommended for new projects)
- Jest - Established, widely used
- Supertest - HTTP assertions
- MSW - API mocking
3. Test Coverage
Happy Paths
- Valid inputs return expected results
- Proper status codes
- Correct response structure
Error Paths
- Invalid input validation
- Authentication failures
- Rate limiting
- Server errors
- Missing required fields
Edge Cases
- Empty requests
- Malformed JSON
- Large payloads
- Special characters
- SQL injection attempts
- XSS attempts
4. Test Structure
describe('API Endpoint', () => {
describe('Success Cases', () => {
it('should handle valid request', () => {})
it('should return correct status code', () => {})
})
describe('Validation', () => {
it('should reject invalid input', () => {})
it('should validate required fields', () => {})
})
describe('Error Handling', () => {
it('should handle server errors', () => {})
it('should return proper error format', () => {})
})
})
5. What to Generate
- Test File - Complete test suite with all scenarios
- Mock Data - Realistic test fixtures
- Helper Functions - Reusable test utilities
- Setup/Teardown - Database/state management
- Quick Test Script - npm script to run tests
Key Testing Principles
- Test behavior, not implementation
- Clear, descriptive test names
- Arrange-Act-Assert pattern
- Independent tests (no shared state)
- Fast execution (<5s for unit tests)
- Realistic mock data
- Test error messages
- Don't test framework internals
- Don't mock what you don't own
- Avoid brittle tests
Additional Scenarios to Cover
Authentication/Authorization
- Valid tokens
- Expired tokens
- Missing tokens
- Invalid permissions
Data Validation
- Type mismatches
- Out of range values
- SQL/NoSQL injection
- XSS payloads
Rate Limiting
- Within limits
- Exceeding limits
- Reset behavior
Performance
- Response times
- Large dataset handling
- Concurrent requests
Generate production-ready tests I can run immediately with npm test.
Установить api-test в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл api-test?
Test API endpoints with automated test generation
Как установить скилл api-test?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл api-test запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic