jest-expert
БесплатноБез исполняемых скриптовНе проверенExpert in Jest unit testing framework, mocks, snapshots, coverage reports, watch mode, and custom matchers. Use when the user mentions testing, unit testing…
от personamanagmentlayer★ 46 звёзд на GitHubОб этом скилле
Jest Expert
Core Concepts
Jest Framework
- Zero Config - Works out of the box
- Snapshot Testing - UI component testing
- Mocking - Functions, modules, and timers
- Code Coverage - Built-in coverage reports
- Watch Mode - Interactive test runner
- Parallel Testing - Fast test execution
Test Structure
- describe/it - Test organization
- Matchers - Assertion library
- Setup/Teardown - beforeEach, afterEach, beforeAll, afterAll
- Mock Functions - jest.fn(), jest.spyOn()
- Async Testing - Promises, async/await
- Test Lifecycle - Hooks and execution order
Advanced Features
- Custom Matchers - Extend expect
- Module Mocking - Mock entire modules
- Timer Mocks - Control time in tests
- Manual Mocks - mocks directory
- Configuration - jest.config.js
- Transformers - Babel, TypeScript support
Best Practices
Test Organization
- One test file per source file
- Group related tests with describe
- Use descriptive test names
- Follow AAA pattern (Arrange, Act, Assert)
- Keep tests simple and focused
- Test behavior, not implementation
Mocking
- Mock external dependencies
- Use jest.fn() for function mocks
- Clear mocks between tests
- Mock at the right level
- Avoid over-mocking
- Document mock behavior
Assertions
- Use specific matchers
- One assertion per test when possible
- Test edge cases
- Verify error conditions
- Use snapshots judiciously
- Provide clear failure messages
Coverage
- Aim for high coverage (80%+)
- Don't chase 100% coverage
- Focus on critical paths
- Test edge cases and errors
- Exclude generated code
- Review coverage reports
Anti-Patterns
Common Mistakes
- Testing implementation details
- Too many assertions in one test
- Sharing state between tests
- Not cleaning up after tests
- Ignoring async/await
- Hard-coding test data
Mocking Issues
- Over-mocking everything
- Not resetting mocks
- Mocking too deep
- Inconsistent mock data
- Forgetting to restore mocks
- Mocking what you don't need
Test Design Problems
- Tests depending on execution order
- Flaky tests due to timing
- No arrange-act-assert structure
- Testing multiple things at once
- Duplicate test code
- Poor test names
Reference Documentation
Detailed material lives alongside this skill and is read on demand:
- Implementation Examples — Basic Unit Tests, Testing Async Code, Mocking and Spies, Snapshot Testing, Testing React Components with React Testing Library, Timer Mocks, Custom Matchers, Configuration (jest.config.js)
Resources
Official Documentation
- Jest Documentation - Complete guide
- API Reference - API docs
- Expect Matchers - Assertion reference
- Mock Functions - Mocking guide
Learning Resources
- Testing JavaScript - Kent C. Dodds course
- Jest Crash Course - Video tutorial
- React Testing Library - React testing
- Jest Cheat Sheet - Quick reference
Tools & Extensions
- VS Code Jest Extension - IDE integration
- jest-watch-typeahead - Better watch mode
- jest-extended - Additional matchers
- snapshot-diff - Snapshot comparison
Community Resources
- GitHub Jest - Source code and issues
- Stack Overflow - Community help
- Discord Jest - Community chat
- Jest Blog - Updates and articles
Установить jest-expert в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGrepGlobВложенные файлы
FAQ
Что делает скилл jest-expert?
Expert in Jest unit testing framework, mocks, snapshots, coverage reports, watch mode, and custom matchers. Use when the user mentions testing, unit testing, JavaScript, QA, mocking, or snapshots, or when the task involves Jest Framework, Test Structure, Advanced Features, or Basic Unit Tests.
Как установить скилл jest-expert?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл jest-expert запускает скрипты?
Нет, скилл состоит только из инструкций (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