testing

testing is a skill for Claude Code from DaleStudy/skills. It costs 119 tokens per session (1,718 once invoked), scanned A, original, MIT.

A guide for testing React components with React Testing Library and Vitest. It emphasizes checking interfaces through the way users find and interact with them.

In plain words
What is it for?
Use it when writing or refactoring React tests, especially for forms, user interactions, and asynchronous logic.
Why use it?
It reduces tests that depend on internal implementation details and gives clearer guidance for accessibility, user actions, and asynchronous behavior.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the dalestudy-skills plugin — 11 skills shipped together

Good fit Use it when writing or refactoring React tests, especially for forms, user interactions, and asynchronous logic.

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

Made for: Claude Code.

Or install dalestudy-skills, the plugin that ships this one along with the rest of its 11 skills.

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 testing

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/dalestudy/skills/testing"><img src="https://agentmods.dev/badge/skills/dalestudy/skills/testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 119 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,718 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
  • Socket pass 18 Mar 2026
  • Snyk pass 26 Feb 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.00119 $0.01718
Opus 5.5 $0.00048 $0.00687
Sonnet 5.5 $0.00024 $0.00344
Haiku 4.5 $0.00012 $0.00172

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

Security

Grade A, and why

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.

The scan reads SKILL.md. This mod also ships 3 executable files (assets/msw-setup.ts, assets/test-setup.ts, assets/vitest.config.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/testing/SKILL.md · 193 lines

How it starts

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

Testing Library

React Testing Library 기반 테스트 작성 모범 관례 및 안티패턴 회피 가이드.

핵심 원칙

Testing Library의 철학: 사용자가 사용하는 방식대로 테스트하라

  1. 접근성 기반 쿼리 우선 - 실제 사용자가 요소를 찾는 방식 사용
  2. 구현 세부사항 테스트 금지 - 컴포넌트 내부 상태/메서드 직접 접근 지양
  3. 실제 사용자 행동 시뮬레이션 - userEvent 사용, fireEvent 지양
  4. 비동기 처리 명시적 대기 - waitFor, findBy 활용

쿼리 우선순위

Testing Library는 다양한 쿼리를 제공하지만, 접근성과 사용자 경험을 반영하는 순서로 사용해야 함.

권장 쿼리 순서 (높음 → 낮음)

  1. getByRole (최우선) - 스크린 리더가 인식하는 방식
  2. getByLabelText - 폼 요소 (label과 연결된 input)
  3. getByPlaceholderText - placeholder가 명확한 경우
  4. getByText - 텍스트 콘텐츠로 검색
  5. getByDisplayValue - 현재 입력된 값으로 검색 (폼 요소)
  6. getByAltText - 이미지 alt 속성
  7. getByTitle - title 속성 (tooltip 등)
  8. getByTestId (최후 수단) - 다른 방법이 불가능할 때만 사용

상세 가이드: references/query-priority.md

사용자 상호작용 테스트

userEvent 사용 (권장)

import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

test('사용자가 폼을 제출할 수 있다', async () => {
  const user = userEvent.setup();
  render(<LoginForm />);

  await user.type(screen.getByRole('textbox', { name: /이메일/i }), '[email protected]');
  await user.type(screen.getByLabelText(/비밀번호/i), 'password123');
  await user.click(screen.getByRole('button', { name: /로그인/i }));

  expect(await screen.findByText(/환영합니다/i)).toBeInTheDocument();
});

핵심:

  • userEvent.setup() 호출 후 사용
  • 모든 user 메서드는 await 필수
  • 실제 브라우저 이벤트 순서 재현 (focus, keydown, keyup 등)

fireEvent 지양

// ❌ 나쁜 예 - fireEvent 사용
fireEvent.click(button);
fireEvent.change(input, { target: { value: "text" } });

// ✅ 좋은 예 - userEvent 사용
await user.click(button);
await user.type(input, "text");

상세 가이드: references/user-events.md

비동기 처리

findBy 쿼리 (권장)

// ✅ 좋은 예 - findBy 사용
const successMessage = await screen.findByText(/저장되었습니다/i);
expect(successMessage).toBeInTheDocument();

findBy = getBy + waitFor 조합 (자동으로 요소 나타날 때까지 대기)

Read the full file on GitHub · 193 lines

Files

What ships with it

7 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 First seen · 193 lines · 119 tokens per session scan A bccd7bd1abc8

Subscribe to this mod's changes

testing is a skill published in the GitHub repository DaleStudy/skills (4 stars, last pushed 2d ago), licensed MIT. It adds 119 tokens to every session and 1,718 once invoked, about $0.0005 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

Other skills, from other repositories

playwright-page-objects

Use when creating page objects or refactoring Playwright E2E tests for better maintainability with Page Object Model patterns.

bartstc/vite-ts-react-template · 30 tokens

test-building-blocks

Test building block catalog — typed patterns for Storybook play-function tests, Vitest hook tests, Vitest unit tests, MSW handlers, and test data fixtures. Read the relevant rule file before writing or modifying any test, handler, or fixture. Covers: deciding which kind of test to write, authoring a new test from…

bartstc/vite-ts-react-template · 0 tokens

test-driven-development

Use when implementing any feature or bugfix, before writing implementation code.

bartstc/vite-ts-react-template · 17 tokens

qa-test-planner

Generate comprehensive test plans, manual test cases, regression test suites, and bug reports for QA engineers. Includes Figma MCP integration for design validation.

bartstc/vite-ts-react-template · 34 tokens

server-side-calls

Call tRPC procedures directly from server code using t.createCallerFactory() and router.createCaller(context) for integration testing, internal server logic, and custom API endpoints. Catch TRPCError and extract HTTP status with getHTTPStatusCodeFromError(). Error handling via onError option.

trpc/trpc · 61 tokens

walkeros-using-cli

Use when bundling walkerOS flows, testing events with simulate/push, running or deploying a built flow (runneros, the walkeros/flow image), validating configs, or configuring Flow JSON files.

elbwalker/walkerOS · 47 tokens