react-native-testing

Installation
Summary

Write and review React Native component tests using Testing Library v13 and v14.

  • Covers render patterns, screen queries (getBy/getAllBy/queryBy/findBy variants), Jest matchers, userEvent interactions, fireEvent, and async patterns with version-specific behavior
  • Automatically detects your project's RNTL version (v13 for React 18, v14 for React 19+) and applies correct API signatures and sync/async rules
  • Provides query priority guidance (getByRole first), interaction best practices (userEvent preferred), and 15+ custom matchers for accessibility and visibility assertions
  • Includes anti-patterns reference and custom render wrapper patterns for providers and test setup
SKILL.md

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

Related skills
Installs
2.1K
GitHub Stars
3.4K
First Seen
Feb 10, 2026