react-testing

react-testing is a skill for Claude Code, Codex from JunMystery/Agent-Guidance-Python. It costs 59 tokens per session (3,160 once invoked), scanned A, a copy of react-testing, MIT.

A guide to testing React components, hooks, and pages based on what users see and do. It covers component test tools, network mocking, accessibility checks, and when to use end-to-end tests that exercise a complete browser flow.

In plain words
What is it for?
Use it when adding or fixing React tests, migrating from Enzyme, setting up Vitest or Jest, mocking HTTP requests, checking accessibility, or deciding between component and end-to-end tests.
Why use it?
It helps choose the right test level and avoid brittle tests that inspect internal implementation details instead of observable behavior.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding or fixing React tests, migrating from Enzyme, setting up Vitest or Jest, mocking HTTP requests, checking accessibility, or deciding between component and end-to-end tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/junmystery/agent-guidance-python/react-testing
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 JunMystery/Agent-Guidance-Python --skill react-testing
Clone the repo
git clone --depth 1 https://github.com/JunMystery/Agent-Guidance-Python

Made for: Claude Code, Codex.

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 react-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/junmystery/agent-guidance-python/react-testing/github.svg)](https://agentmods.dev/skills/junmystery/agent-guidance-python/react-testing)
Your own site
<a href="https://agentmods.dev/skills/junmystery/agent-guidance-python/react-testing"><img src="https://agentmods.dev/badge/skills/junmystery/agent-guidance-python/react-testing/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 react-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/junmystery/agent-guidance-python/react-testing"><img src="https://agentmods.dev/badge/skills/junmystery/agent-guidance-python/react-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,160 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.
Origin 91% copy Near-identical to another mod 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.00059 $0.03160
Opus 5.5 $0.00024 $0.01264
Sonnet 5.5 $0.00012 $0.00632
Haiku 4.5 $0.00006 $0.00316

Measured 1mo ago against content hash a11c1a5ff8da, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

react-testing 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 1mo 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.

Origin

This is a copy

91% identical to react-testing — 5 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/react-testing/SKILL.md · 425 lines

How it starts

The opening of the file, as written. The whole thing — 425 lines — stays where its author put it; the contents beside it link to each section on GitHub.

React Testing

Comprehensive React testing patterns for behavior-focused component tests, custom hook tests, accessibility assertions, and network-level mocking.

When to Activate

  • Writing tests for React components, custom hooks, or pages
  • Adding test coverage to legacy untested components
  • Migrating from Enzyme or class-component-era patterns to React Testing Library
  • Setting up Vitest or Jest for a new React project
  • Mocking HTTP requests in tests
  • Asserting accessibility violations
  • Deciding which tests belong in RTL vs Playwright Component Testing vs full E2E

Core Principle

Test what the user sees and does, not implementation details.

A test should:

  • Render the component with the same providers it has in production
  • Interact with it via accessible queries (role, label) and userEvent
  • Assert visible output and observable side effects (callback fired, request sent)

A test should NOT:

  • Inspect component state, props passed to children, or which hooks were called
  • Mock React itself or framework hooks
  • Assert on the number of renders or DOM structure beyond what affects users

Library Choice

Runner When Note
Vitest Vite, Remix, modern setups Faster, native ESM, Jest-compatible API
Jest Next.js, CRA, established repos Default for many React projects
Playwright Component Testing Real browser engine needed Use when JSDOM lacks the required feature
Cypress Component Testing Real browser, Cypress already in use Alternative to Playwright CT

Pick one. Do not run RTL + Vitest AND Playwright CT in the same repo unless you have a clear lane separation.

Query Priority

React Testing Library exposes queries in three tiers — use top-down:

  1. Accessible to everyone: getByRole, getByLabelText, getByPlaceholderText, getByText, getByDisplayValue
  2. Semantic: getByAltText, getByTitle
  3. Test IDs (escape hatch): getByTestId
// Best
screen.getByRole("button", { name: /save/i });

// OK for inputs
screen.getByLabelText("Email");

// Last resort
screen.getByTestId("save-btn");

Read the full file on GitHub · 425 lines

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. 1mo ago First seen · 425 lines · 59 tokens per session scan A a11c1a5ff8da

Subscribe to this mod's changes

react-testing is a skill published in the GitHub repository JunMystery/Agent-Guidance-Python (2 stars, last pushed 2mo ago), licensed MIT. It adds 59 tokens to every session and 3,160 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 91% identical to react-testing, differing in 5 lines, and is treated as a copy.

Related

Other skills, from other repositories

verify-work

Verify feature, bug, UI, API, mobile, security, or deployment work against acceptance criteria.

HoangNguyen0403/agent-skills-standard · 23 tokens

angular-testing

Write Angular component tests using TestBed, ComponentHarness, and HttpTestingController with proper signal input handling. Use when writing component tests, mocking HTTP calls, or testing signal inputs.

HoangNguyen0403/agent-skills-standard · 39 tokens

tests-run

Execute Unity tests (EditMode or PlayMode) and return per-test results. Supports filtering by test assembly, namespace, class, and method. Refreshes the AssetDatabase first; defers execution across domain reloads if scripts changed. Precondition: every open scene must be saved — dirty scenes abort the run.

IvanMurzak/Unity-MCP · 68 tokens

vitest

Set up Vitest testing in any project — detects type (Cloudflare Workers, React, Node, library), generates vitest.config.ts, test setup, utilities, and a sample test. Covers mocking patterns, coverage config, workspace setup, Jest migration. Use whenever the user mentions adding tests, setting up Vitest, configuring…

jezweb/claude-skills · 87 tokens

test-loop

Plan, generate, and heal an executable E2E test suite from approved acceptance criteria (web and mobile).

HoangNguyen0403/agent-skills-standard · 25 tokens

common-subagent-driven-development

Execute multi-task implementation plans by dispatching a fresh implementer subagent per task with independent review gates. Use when implementing plans, executing multi-task PRs, or transitioning from planning to implementation.

HoangNguyen0403/agent-skills-standard · 45 tokens