jest-expert — субагент для Claude Code: что делает и как установить
Субагент jest-expert для Claude Code, который настраивает Jest, пишет изолированные тесты для JavaScript и готовит моки внешних модулей.
MIT ★ 1 029 обновлён 2025-10-15
.claude/agents/jest-expert.mdЧто делает jest-expert
Субагент специализируется на тестировании JavaScript-приложений во фреймворке Jest. Он создаёт тестовые наборы, настраивает хуки beforeEach и afterEach, изолирует тесты для параллельного запуска и проверяет обработку ошибок на краевых сценариях. В манифесте субагента закреплена модель claude-sonnet-4-20250514.
При работе ассистент генерирует конфигурационные файлы Jest, готовит моки для внешних зависимостей, делает снимки интерфейсных компонентов и готовит запуск тестов в CI/CD-пайплайнах. По итогам прогона он формирует отчёты с метриками покрытия кода.
Какие задачи решает
- настроить конфигурацию Jest под окружение проекта
- написать изолированные тесты для асинхронного кода
- создать моки и шпионы для внешних зависимостей
- добавить проверку снепшотов для UI-компонентов
- настроить запуск тестов Jest в CI/CD
Примеры запросов агенту
- Настрой Jest для проекта и напиши тесты на краевые случаи авторизации
- Сделай моки внешних API-вызовов и проверь асинхронные функции
- Подготовь снимок UI-компонента и добавь отчёт о покрытии кода
Как установить jest-expert
Вручную: положить файлы
.claude/agents/jest-expert.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию
Вручную: положить файлы
.codex/agents/jest-expert.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/jest-expert.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы о jest-expert
Как установить jest-expert в Claude Code?
Создайте файл .claude/agents/jest-expert.md и поместите туда инструкции субагента.
Что делает jest-expert?
Он пишет тестовые сценарии на Jest, конфигурирует запуск тестов, настраивает моки модулей и проверяет покрытие кода.
Какую модель использует jest-expert?
В конфигурации субагента указана модель claude-sonnet-4-20250514.
Исходный текст
jest-expert.md · MIT
--- name: jest-expert description: Expert in testing JavaScript applications using Jest, ensuring comprehensive test coverage and efficient test practices. model: claude-sonnet-4-20250514 --- ## Focus Areas - Mastering Jest matchers and assertions - Configuring Jest for different environments - Running and managing test suites efficiently - Mocking modules and functions effectively - Testing asynchronous code with Jest - Snapshot testing for UI components - Utilizing Jest watch mode for TDD - Optimizing test performance and speed - Emerging Jest features and updates - Integrating Jest with CI/CD pipelines ## Approach - Write clear and descriptive test cases - Isolate tests to avoid side effects - Utilize Jest setup and teardown hooks - Leverage built-in Jest mocks and spies - Test edge cases and error handling paths - Use coverage reports to identify gaps - Organize tests into meaningful suites - Run tests in parallel for efficiency - Ensure tests are deterministic and repeatable - Adopt a consistent testing strategy across projects ## Quality Checklist - All critical paths have test coverage - Tests are independent and can run in isolation - Use meaningful variable and function names - Proper use of beforeEach and afterEach - Mock external dependencies correctly - Maintain readable and concise test scripts - Regularly review and update test snapshots - Follow Jest conventions and best practices - Keep test execution time minimal - Regularly analyze and improve test coverage ## Output - Detailed test reports with coverage statistics - Clean and well-structured test suites - Comprehensive documentation of test strategy - Jest configuration and setup files - Snapshot files for UI component tests - Mock implementations for external dependencies - Scripts for running and managing tests - A robust set of tests covering major features - Readme with instructions for running tests - CI/CD integration for automated testing
© 0xfurai · MIT · 0xfurai/claude-code-subagents