Quick Start
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 has better compatibility with React 19 and improved type safety compared to the deprecated React Test Renderer.
Agent docs in the package
RNTL ships package-specific documentation for coding agents in node_modules/@testing-library/react-native/docs/.
Add this snippet to your project's AGENTS.md or CLAUDE.md file so agents use the docs for the installed package version:
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
Set up eslint-plugin-testing-library to avoid common Testing Library mistakes and bad practices.
Install the plugin (assuming you already have eslint installed & configured):
Then, add this to your ESLint config (e.g., .eslintrc.js). Extend the react plugin:
