testing-library
Installation
SKILL.md
Testing Library (React/DOM)
The guiding principle: "The more your tests resemble the way your software is used, the more confidence they can give you." It encourages testing behavior (what the user sees) rather than implementation details (state, props).
When to Use
- React Components: The industry standard (
@testing-library/react). - Accessibility Testing: It inherently encourages accessible code (
getByRole).
Quick Start
import { render, screen, fireEvent } from "@testing-library/react";
import App from "./App";