Testing Library
A family of testing libraries that render components and query them the way users find them, by role, label and text.
In more detail
Queries such as getByRole("button", { name: "Save" }) rely on the accessibility tree, so tests double as accessibility checks. Its user-event package simulates realistic typing and clicking; Storybook play functions use it too.
Related terms
- jest-axe — A library that runs axe-core in Jest-style tests and adds the toHaveNoViolations matcher.
- play function — A function on a Storybook story that runs after it renders, simulating user actions and asserting on the result.
- unit test — An automated check of one small piece of code, such as a single function, that runs quickly and on its own.
Taught in
- Automated Accessibility Testing: axe-core & Testing Library — Design Systems & Component Engineering
- Storybook & Component Driven Development Workflows — Design Systems & Component Engineering