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.
npx skills add ronmkr/PromptBook --skill react-testinggit clone --depth 1 https://github.com/ronmkr/PromptBookWrote 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.
[](https://agentmods.dev/skills/ronmkr/promptbook/react-testing)<a href="https://agentmods.dev/skills/ronmkr/promptbook/react-testing"><img src="https://agentmods.dev/badge/skills/ronmkr/promptbook/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.
<a href="https://agentmods.dev/skills/ronmkr/promptbook/react-testing"><img src="https://agentmods.dev/badge/skills/ronmkr/promptbook/react-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00059 | $0.03155 |
| Opus 5.5 | $0.00024 | $0.01262 |
| Sonnet 5.5 | $0.00012 | $0.00631 |
| Haiku 4.5 | $0.00006 | $0.00315 |
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 3mo 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.
This is a copy
98% identical to react-testing — 2 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.
How it starts
The opening of the file, as written. The whole thing — 424 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:
- Accessible to everyone:
getByRole,getByLabelText,getByPlaceholderText,getByText,getByDisplayValue - Semantic:
getByAltText,getByTitle - Test IDs (escape hatch):
getByTestId
// Best
screen.getByRole("button", { name: /save/i });
// OK for inputs
screen.getByLabelText("Email");
// Last resort
screen.getByTestId("save-btn");
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.
- 3mo ago First seen · 424 lines · 59 tokens per session scan A 5c74a1f3bda3
react-testing is a skill published in the GitHub repository ronmkr/PromptBook (2 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 59 tokens to every session and 3,155 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 98% identical to react-testing, differing in 2 lines, and is treated as a copy.
react-testing compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| react-testingronmkr/PromptBook | Skill | 2 | 6mo ago | Apache-2.0 | A | 59 | Claude Code, Codex |
| storybook-testingyonatangross/orchestkit | Skill | 317 | today | MIT | A | 62 | Claude Code |
| browser-qadamianvtran/local-operator | Skill | 235 | today | MIT | A | 45 | Claude Code, Codex |
| knowledge-engineering-quality-and-delivery-real-api-qualification-and-e2eechoVic/blade-code | Skill | 181 | 20d ago | MIT | A | 182 | Claude Code, Codex |
| knowledge-engineering-quality-and-delivery-unit-integration-and-shared-test-harnessesechoVic/blade-code | Skill | 181 | 20d ago | MIT | A | 184 | Claude Code, Codex |
| webapp-testingJNZader/repoforge | Skill | 4 | 2mo ago | MIT | A | 49 | Claude Code |
| frontend-component-patternscontactandrewchl-wq/turtle-mcp | Skill | 2 | 5mo ago | MIT | A | 63 | Claude Code |