How it works
Instead of reaching into a component's internal state, Testing Library queries the rendered page by role, label or visible text, for example getByRole('button', { name: 'Pay' }). The user-event package simulates real typing and clicking, and jest-dom adds readable checks such as toBeVisible. Versions exist for React, Vue, Svelte, Angular, plain DOM and React Native.
It is not a test runner: it runs inside Jest or Vitest, usually with jsdom, and Cypress has an adapter, while Playwright's own locators follow the same idea. Because tests find elements the way assistive technology does, they nudge code towards accessible markup, and they survive refactors that do not change what users see.
Testing Library pricing
Related terms
More in Testing and quality
Test runners