jest-rtl-testing

jest-rtl-testing is a skill for Claude Code, Codex from lanamaysu/agent-skills. It costs 28 tokens per session (776 once invoked), scanned A, original, MIT.

Guidance for writing and debugging Jest tests with React Testing Library, tools for checking React interfaces from a user's point of view.

In plain words
What is it for?
Use it when creating, reviewing, refactoring, or debugging tests for React components and their user interactions.
Why use it?
It helps tests focus on visible behaviour instead of fragile implementation details, and helps identify common test failures or misuse of the tools.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Use it when creating, reviewing, refactoring, or debugging tests for React components and their user interactions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lanamaysu/agent-skills/jest-rtl-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 lanamaysu/agent-skills --skill jest-rtl-testing
Clone the repo
git clone --depth 1 https://github.com/lanamaysu/agent-skills

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin jest-rtl-testing — /plugin install jest-rtl-testing after adding the marketplace above.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/lanamaysu/agent-skills/jest-rtl-testing"><img src="https://agentmods.dev/badge/skills/lanamaysu/agent-skills/jest-rtl-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 776 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 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.00028 $0.00776
Opus 5.5 $0.00011 $0.00310
Sonnet 5.5 $0.00006 $0.00155
Haiku 4.5 $0.00003 $0.00078

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

Security

Grade A, and why

jest-rtl-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.

skills/jest-rtl-testing/SKILL.md · 77 lines

How it starts

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

Jest + React Testing Library Best Practices

Core principle: A test interacts with the application as a user does. A test does not check implementation details.

Pre-Check

Do these steps before you write a test:

  1. Find AGENTS.md in the project root. If it exists, read its Testing section.
  2. Follow the AGENTS.md rules when they conflict with this skill.

Do not use this skill for pure-function tests (no DOM, no React), E2E tests, performance tests or visual regression tests.


Quick Reference

Query Priority

getByRole is slow on large views (issue 820), so the list puts getByLabelText and getByText first.

Use the first query in this list that finds the element:

  1. getByLabelText: use for form fields.
  2. getByText: use for non-interactive content.
  3. getByRole: use only in small components. It also checks accessibility.
  4. getByPlaceholderText, getByDisplayValue, getByAltText.
  5. getByTestId: use only when no query above works. Add a code comment that tells why no accessible query works.

Query types:

  • getBy*: the element must exist. The query throws an error if it finds no element.
  • queryBy*: use to assert that an element is absent. The query returns null.
  • findBy*: use to wait for an element. The query returns a Promise.

Core Principles

  1. Async: Use findBy* to wait for an element to appear. Use waitForElementToBeRemoved to wait for an element to disappear.
  2. Real interactions: Use @testing-library/user-event. Do not use fireEvent when user-event can do the interaction.
  3. HTTP mocks: Use MSW to mock network requests. Do not mock fetch or axios manually.

Debugging

  • Use screen.debug() to show the DOM.
  • Make sure that the query type is correct: getBy*, queryBy* or findBy*.
  • Use screen.logTestingPlaygroundURL() to find a better query.

References

Do not read a reference file from start to end. Find the heading with grep -n '^#' <file>, then read only that section.

Read the full file on GitHub · 77 lines

Files

What ships with it

4 files 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. 1mo ago Changed · -16 lines 9076f85330e7
  2. 2mo ago First seen · 93 lines · 28 tokens per session scan A 4fdc9cae2392

Subscribe to this mod's changes

jest-rtl-testing is a skill published in the GitHub repository lanamaysu/agent-skills (2 stars, last pushed 1mo ago), licensed MIT. It adds 28 tokens to every session and 776 once invoked, about $0.0001 per session on Opus 5.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-08-31.

Related

jest-rtl-testing compared with skills from other repositories

jest-rtl-testing next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
jest-rtl-testinglanamaysu/agent-skillsSkill21mo agoMITA28Claude Code, Codex
react-native-testingcallstack/react-native-testing-librarySkill3.4k2d agoMITA134Claude Code, Codex
verify-workHoangNguyen0403/agent-skills-standardSkill583todayMITA23Codex
vitestjezweb/claude-skillsSkill1.1k1mo agoMITA87Claude Code
authoring-data-quality-checksPostHog/posthogSkill41ktodaynoneA174Claude Code, Codex
appbuilder-testingadobe/skillsSkill321todayApache-2.0A201Claude Code
authoring-benchmarksNVIDIA/elementsSkill115yesterdayApache-2.0A105Claude Code, Codex