jest-expert — Claude Code subagent: what it does, how to install
jest-expert — a Claude Code subagent that configures Jest, creates isolated JavaScript tests, handles mocks, and sets up coverage reporting.
MIT ★ 1,029 updated 2025-10-15
.claude/agents/jest-expert.mdWhat jest-expert does
This subagent focuses on testing JavaScript applications with the Jest framework. It writes structured test suites, configures beforeEach and afterEach lifecycle hooks, and tests error-handling edge cases. Its definition explicitly designates the claude-sonnet-4-20250514 model.
The agent produces environment configurations for Jest, mock implementations for external packages, and UI snapshot tests. It also adds test run scripts, sets up CI/CD automation pipelines, and evaluates code coverage reports.
What it helps with
- configure Jest for specific project environments
- write isolated tests for asynchronous JavaScript logic
- generate mock modules and spies for external services
- create snapshot tests for frontend UI components
- integrate automated Jest runs into CI/CD pipelines
Example prompts for the agent
- Configure Jest and write unit tests for the asynchronous payment handler
- Mock the external API module and verify error-handling paths
- Generate UI snapshots for new components and calculate test coverage
How to install jest-expert
Manually: put the files in place
.claude/agents/jest-expert.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/jest-expert.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/jest-expert.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about jest-expert
How do I install jest-expert in Claude Code?
Add the subagent configuration file directly at .claude/agents/jest-expert.md.
What does jest-expert do?
It designs Jest test suites, mocks external dependencies, generates UI snapshot tests, and configures test runs for CI/CD.
Which model powers jest-expert?
The agent configuration is pinned to claude-sonnet-4-20250514.
Source text
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