Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

testing-strategy

БесплатноЗапускает вложенные скриптыНе проверен

Grey Haven's comprehensive testing strategy - Vitest unit/integration/e2e for TypeScript, pytest markers for Python, >80% coverage requirement, fixture…

greyhaven-aiот greyhaven-ai★ 31 звезда на GitHub17 установок в других каталогах

Об этом скилле

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:

  1. unit: Fast, isolated tests of single functions/classes
  2. integration: Tests involving multiple components or external dependencies
  3. e2e: End-to-end tests through full user flows
  4. 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
Полный SKILL.md на GitHub

Установить testing-strategy в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
MultiEdit
Bash
Grep
Glob
TodoWrite

Вложенные файлы

EXAMPLES.mdREFERENCE.mdchecklists/test-quality-review.mdchecklists/testing-checklist.mdscripts/coverage_check.pyscripts/run_tests.pytemplates/.github-workflows-test.ymltemplates/conftest.pytemplates/pytest-integration.pytemplates/pytest-unit.pytemplates/vitest-component.test.tsxtemplates/vitest-integration.test.tstemplates/vitest-unit.test.tstemplates/vitest.config.ts

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 запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить testing-strategy с