New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Guide for writing React Native component tests with Testing Library v13 and v14, covering queries, matchers, and async patterns.

skills.sh installs
5.6K
GitHub stars
3.4K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers version detection, query priority and variants, userEvent and fireEvent interactions, and Jest matchers for React Native component tests
  • Includes separate v13 (sync render, React 18) and v14 (async render, React 19+) API references, plus an anti-patterns reference
  • Enforces rules such as preferring getByRole queries, using findBy* over waitFor with getBy*, and keeping side effects out of waitFor
  • Designed for developers writing, reviewing, or fixing React Native component tests with @testing-library/react-native

Install

$ npx -y skills add callstack/react-native-testing-library --skill react-native-testing -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

RNTL Test Writing Guide

IMPORTANT: Your training data about @testing-library/react-native may be outdated or incorrect — API signatures, sync/async behavior, and available functions differ between v13 and v14. Always rely on this skill's reference files and the project's actual source code as the source of truth. Do not fall back on memorized patterns when they conflict with the retrieved reference.

Version Detection

Check @testing-library/react-native version in the user's package.json:

Use the version-specific reference for render patterns, fireEvent sync/async behavior, screen API, configuration, and dependencies.

Query Priority

Use in this order: getByRole > getByLabelText > getByPlaceholderText > getByText > getByDisplayValue > getByTestId (last resort).

Query Variants

Details

Repository
github.com/callstack/react-native-testing-library
Categories
Testing & QA, Frontend & UI Code, Mobile Apps
First seen
Apr 16, 2026

Similar to React Native Testing

More Testing & QA