testing-strategy
БесплатноЗапускает вложенные скриптыНе проверенGrey Haven's comprehensive testing strategy - Vitest unit/integration/e2e for TypeScript, pytest markers for Python, >80% coverage requirement, fixture…
Об этом скилле
Grey Haven Testing Strategy
Comprehensive testing approach for TypeScript (Vitest) and Python (pytest) projects.
Follow these standards when writing tests, setting up test infrastructure, or improving test coverage in Grey Haven codebases.
Supporting Documentation
- EXAMPLES.md - Copy-paste test examples for Vitest and pytest
- REFERENCE.md - Complete configurations, project structures, and CI setup
- templates/ - Ready-to-use test templates
- checklists/ - Testing quality checklists
- scripts/ - Helper scripts for coverage and test execution
Testing Philosophy
Coverage Requirements
- Minimum: 80% code coverage for all projects (enforced in CI)
- Target: 90%+ coverage for critical paths
- 100% coverage for security-critical code (auth, payments, multi-tenant isolation)
Test Types (Markers)
Grey Haven uses consistent test markers across languages:
- unit: Fast, isolated tests of single functions/classes
- integration: Tests involving multiple components or external dependencies
- e2e: End-to-end tests through full user flows
- benchmark: Performance tests measuring speed/memory
TypeScript Testing (Vitest)
Quick Setup
Project Structure:
tests/
├── unit/ # Fast, isolated tests
├── integration/ # Multi-component tests
└── e2e/ # Playwright tests
Key Configuration:
// vitest.config.ts
export default defineConfig({
test: {
globals: true,
environment: "jsdom",
setupFiles: ["./tests/setup.ts"],
coverage: {
thresholds: { lines: 80, functions: 80, branches: 80, statements: 80 },
},
},
});
Running Tests:
bun run test # Run all tests
bun run test:coverage # With coverage report
bun run test:watch # Watch mode
bun run test:ui # UI mode
bun run test tests/unit/ # Unit tests only
See EXAMPLES.md for complete test examples.
Python Testing (pytest)
Quick Setup
Project Structure:
tests/
├── conftest.py # Shared fixtures
├── unit/ # @pytest.mark.unit
├── integration/ # @pytest.mark.integration
├── e2e/ # @pytest.mark.e2e
└── benchmark/ # @pytest.mark.benchmark
Key Configuration:
# pyproject.toml
[tool.pytest.ini_options]
addopts = ["--cov=app", "--cov-fail-under=80"]
markers = [
"unit: Fast, isolated unit tests",
"integration: Tests involving multiple components",
"e2e: End-to-end tests through full flows",
"benchmark: Performance tests",
]
Running Tests:
# ⚠️ ALWAYS activate virtual environment first!
source .venv/bin/activate
# Run with Doppler for environment variables
doppler run -- pytest # All tests
doppler run -- pytest --cov=app # With coverage
doppler run -- pytest -m unit # Unit tests only
doppler run -- pytest -m integration # Integration tests only
doppler run -- pytest -m e2e # E2E tests only
doppler run -- pytest -v # Verbose output
See EXAMPLES.md for complete test examples.
Test Markers Explained
Unit Tests
Characteristics:
- Fast execution (< 100ms per test)
- No external dependencies (database, API, file system)
- Mock all external services
- Test single function/class in isolation
Use for:
- Utility functions
- Business logic
- Data transformations
- Component rendering (React Testing Library)
Integration Tests
Characteristics:
- Test multiple components together
- May use real database/Redis (with cleanup)
- Test API endpoints with FastAPI TestClient
- Test React Query + server functions
Use for:
- API endpoint flows
- Database operations with repositories
- Authentication flows
- Multi-component interactions
E2E Tests
Characteristics:
- Test complete user flows
- Use Playwright (TypeScript) or httpx (Python)
- Test from user perspective
- Slower execution (seconds per test)
Use for:
- Registration/login flows
- Critical user journeys
- Form submissions
- Multi-page workflows
Benchmark Tests
Characteristics:
- Measure performance metrics
- Track execution time
- Monitor memory usage
- Detect performance regressions
Use for:
- Database query performance
- Algorithm optimization
- API response times
- Batch operations
Environment Variables with Doppler
⚠️ CRITICAL: Grey Haven uses Doppler for ALL environment variables.
# Install Doppler
brew install dopplerhq/cli/doppler
# Authenticate and setup
doppler login
doppler setup
# Run tests with Doppler
doppler run -- bun run test # TypeScript
doppler run -- pytest # Python
# Use specific config
doppler run --config te
Установить testing-strategy в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteMultiEditBashGrepGlobTodoWriteВложенные файлы
FAQ
Что делает скилл testing-strategy?
Grey Haven's comprehensive testing strategy - Vitest unit/integration/e2e for TypeScript, pytest markers for Python, >80% coverage requirement, fixture patterns, and Doppler for test environments. Use when writing tests, setting up test infrastructure, running tests, debugging test failures, improving coverage, configuring CI/CD, or when user mentions 'test', 'testing', 'pytest', 'vitest', 'coverage', 'TDD', 'test-driven development', 'unit test', 'integration test', 'e2e', 'end-to-end', 'test fixtures', 'mocking', 'test setup', 'CI testing'.
Как установить скилл testing-strategy?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл testing-strategy запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic