Skip to main content

Testing Library

Simple and complete testing utilities that encourage good testing practices

The more your tests resemble the way your software is used,
the more confidence they can give you.

Write Maintainable Tests

Tests only break when your app breaks, not implementation details

Develop with Confidence

Interact with your app the same way as your users

Accessible by Default

Built-in selectors find elements the way users do to help you write inclusive code

The problem (picture of a question mark)

The Problem

  • You want tests for your UI that avoid including implementation details and rather focus on making your tests give you the confidence for which they are intended.
  • You want your tests to be maintainable so refactors (changes to implementation but not functionality) don't break your tests and slow you and your team down.

The Solution

The Testing Library family of libraries is a very light-weight solution for testing without all the implementation details. The main utilities it provides involve querying for nodes similarly to how users would find them. In this way, testing-library helps ensure your tests give you confidence in your UI code.

The solution (picture of a star)
The guiding principle (picture of a brick wall)

Guiding Principle

The more your tests resemble the way your software is used, the more confidence they can give you.

Who is Using This?

AutodeskExpedia GroupFacebook Open SourcePayPalWalmart Labs
More Testing Library Users

Awards

Winner of the Open Source Awards 2019 in the category "The most impactful contribution to the community"
Winner of the State of JS 2020 award for the technology with the highest percentage of satisfied users