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
Write Maintainable Tests
Tests only break when your app breaks, not implementation details
Develop with Confidence
Develop with Confidence
Interact with your app the same way as your users
Accessible by Default
Accessible by Default
Built-in selectors find elements the way users do to help you write inclusive code
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.
Guiding Principle
Guiding Principle
The more your tests resemble the way your software is used, the more confidence they can give you.