Quick Start
This version is currently in alpha. APIs and behavior may change before the stable release. Please report any issues you encounter.
Installation
Open a Terminal in your project's folder and run:
This library has a peer dependency on Test Renderer. Make sure to install it:
Test Renderer provides better compatibility with React 19 and improved type safety compared to the deprecated React Test Renderer.
Jest matchers
RNTL automatically extends Jest with React Native-specific matchers. The only thing you need to do is to import anything from @testing-library/react-native which you already need to do to access the render function.
ESLint plugin
We recommend setting up eslint-plugin-testing-library package to help you avoid common Testing Library mistakes and bad practices.
Install the plugin (assuming you already have eslint installed & configured):
Then, add relevant entry to your ESLint config (e.g., .eslintrc.js). We recommend extending the react plugin:
