Skip to content
Conduit

skill

jest-skill

AI agent skill for Jest 29/30 — 28 rules: mocks, async, timers, snapshots, CI. Works with Claude Code, Cursor, Codex, Windsurf.

anivar/jest-skillcommunitylistedunreviewed

Set up

Skills are installed by placing their folder where your agent loads skills.

The download comes from github.com/anivar/jest-skill itself, not from our server, so what you get is exactly what its author published.

Install instructions come from the README

Skills do not use an MCP config. Follow the steps in the README below.

README

synced Oct 20, 2026

Jest Skill

An AI agent skill for writing, debugging, and reviewing Jest tests with modern best practices.

Created by Anivar Aravind

The Problem

AI agents frequently generate outdated or incorrect Jest patterns — wrong mock cleanup semantics (clearAllMocks vs restoreAllMocks), missing await on async assertions, incorrect timer mock usage, factory hoisting bugs, and anti-patterns that cause tests to silently pass without actually asserting anything. These produce test suites that compile and pass but don't test what they claim to test.

This Solution

28 rules with incorrect→correct code examples that teach agents Jest's actual API behavior, mock lifecycle, async patterns, timer control, module mocking, snapshot testing, configuration, and CI optimization. Each rule targets a specific mistake and shows exactly how to fix it.

Install

npx skills add anivar/jest-skill -g

Or with full URL:

npx skills add https://github.com/anivar/jest-skill

Baseline

  • jest ^30.5.2 (audited against jest 30.5.2)
  • JavaScript / TypeScript

What's Inside

28 Rules Across 9 Categories

PriorityCategoryRulesImpact
1Mock Design5CRITICAL
2Async Testing3CRITICAL
3Matcher Usage3HIGH
4Timer Mocking3HIGH
5Test Structure3HIGH
6Module Mocking3MEDIUM
7Snapshot Testing3MEDIUM
8Configuration3MEDIUM
9Performance & CI2MEDIUM

Each rule file contains:

  • Why it matters
  • Incorrect code with explanation
  • Correct code with explanation
  • Decision tables and additional context

9 Deep-Dive References

ReferenceCovers
matchers.mdAll matchers: equality, truthiness, numbers, strings, arrays, objects, asymmetric, custom
mock-functions.mdjest.fn, jest.spyOn, .mock property, return values, implementations, mock matchers
jest-object.mdjest.mock, jest.useFakeTimers, jest.setTimeout, jest.retryTimes, jest.replaceProperty
async-patterns.mdPromises, async/await, done callbacks, .resolves/.rejects, expect.assertions
configuration.mdKey config options: testMatch, transform, moduleNameMapper, coverage, environments
snapshot-testing.mdtoMatchSnapshot, inline snapshots, property matchers, serializers, updating
module-mocking.mdManual mocks, mocks directory, ESM mocking, partial mocking, jest.requireActual
anti-patterns.md15 common mistakes with BAD/GOOD examples
ci-and-debugging.mdCI optimization, --runInBand, --shard, debugging with inspector, troubleshooting

Structure

├── SKILL.md                          # Entry point for AI agents
├── AGENTS.md                         # Compiled guide with all rules expanded
├── rules/                            # Individual rules (Incorrect→Correct)
│   ├── mock-*                        # Mock design (CRITICAL)
│   ├── async-*                       # Async testing (CRITICAL)
│   ├── matcher-*                     # Matcher usage (HIGH)
│   ├── timer-*                       # Timer mocking (HIGH)
│   ├── structure-*                   # Test structure (HIGH)
│   ├── module-*                      # Module mocking (MEDIUM)
│   ├── snapshot-*                    # Snapshot testing (MEDIUM)
│   ├── config-*                      # Configuration (MEDIUM)
│   └── perf-*                        # Performance & CI (MEDIUM)
└── references/                       # Deep-dive reference docs
    ├── matchers.md
    ├── mock-functions.md
    ├── jest-object.md
    ├── async-patterns.md
    ├── configuration.md
    ├── snapshot-testing.md
    ├── module-mocking.md
    ├── anti-patterns.md
    └── ci-and-debugging.md

Ecosystem — Skills by Anivar Aravind

This Jest skill covers Jest's own API surface — the foundation layer. For framework-specific testing patterns built on top of Jest, use companion skills:

Testing Skills (Jest Foundation)

NeedSkillInstall
API mocking (network-level)msw-skill — MSW 2.0 handlers, server lifecycle, per-test overridesnpx skills add anivar/msw-skill -g
React Native componentsreact-native-testing — RNTL v13/v14 queries, userEvent, async rendernpx skills add anivar/react-native-testing -g
Zod schema validationzod-testing — safeParse testing, mock data, property-based testingnpx skills add anivar/zod-testing -g
Redux-Saga side effectsredux-saga-testing — expectSaga, testSaga, providersnpx skills add anivar/redux-saga-testing -g

Library & Framework Skills

SkillWhat it coversInstall
zod-skillZod v4 schema validation, parsing, error handling, type inferencenpx skills add anivar/zod-skill -g
redux-saga-skillRedux-Saga effects, fork model, channels, RTK integrationnpx skills add anivar/redux-saga-skill -g
msw-skillMSW 2.0 API mocking — handlers, responses, GraphQL, v1→v2 migrationnpx skills add anivar/msw-skill -g

Engineering Analysis Skills

SkillWhat it coversInstall
contributor-codebase-analyzerDeep-dive code analysis, annual reviews, promotion readinessnpx skills add anivar/contributor-codebase-analyzer -g

Author

Anivar Aravind — Building AI agent skills for modern JavaScript/TypeScript development.

License

MIT

↑↓ navigate openesc close