jest-expert

jest-expert is a skill for Claude Code from personamanagmentlayer/pcl. It costs 65 tokens per session (1,161 once invoked), scanned A, original, Apache-2.0.

A guide to Jest, a JavaScript and TypeScript tool for running automated tests. It covers test structure, assertions, mocks, snapshots, asynchronous code, timers, coverage, and configuration.

In plain words
What is it for?
Use it to create unit tests, mock functions or modules, test promises and timers, check UI snapshots, configure Jest, and inspect code-coverage reports.
Why use it?
It helps an agent write tests that match Jest's conventions and isolate code from outside services. It also explains how to test asynchronous behaviour and record expected output with snapshots.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to create unit tests, mock functions or modules, test promises and timers, check UI snapshots, configure Jest, and inspect code-coverage reports.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/personamanagmentlayer/pcl/jest-expert
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add personamanagmentlayer/pcl --skill jest-expert
Clone the repo
git clone --depth 1 https://github.com/personamanagmentlayer/pcl

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for jest-expert

README.md
[![agentmods](https://agentmods.dev/badge/skills/personamanagmentlayer/pcl/jest-expert/github.svg)](https://agentmods.dev/skills/personamanagmentlayer/pcl/jest-expert)
Your own site
<a href="https://agentmods.dev/skills/personamanagmentlayer/pcl/jest-expert"><img src="https://agentmods.dev/badge/skills/personamanagmentlayer/pcl/jest-expert/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for jest-expert

Your own site · 80×15
<a href="https://agentmods.dev/skills/personamanagmentlayer/pcl/jest-expert"><img src="https://agentmods.dev/badge/skills/personamanagmentlayer/pcl/jest-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,161 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00065 $0.01161
Opus 5 $0.00032 $0.00580
Sonnet 5 $0.00013 $0.00232
Haiku 4.5 $0.00006 $0.00116

Measured 5d ago against content hash a1a66d5a46f6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

jest-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

stdlib/qa/jest-expert/SKILL.md · 168 lines

How it starts

The opening of the file, as written. The whole thing — 168 lines — stays where its author put it; the contents beside it link to each section on 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

Read the full file on GitHub · 168 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 168 lines · 65 tokens per session scan A a1a66d5a46f6

Subscribe to this mod's changes

jest-expert is a skill published in the GitHub repository personamanagmentlayer/pcl (40 stars, last pushed 3d ago), licensed Apache-2.0. It adds 65 tokens to every session and 1,161 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.