react-native-testing

Guide React Native Testing Library tests for queries, assertions, and async flows.

28|1|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/bidah/react-native-hifi --skill react-native-testing-bidah
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-native-testing
Source: https://github.com/bidah/react-native-hifi/tree/main/skills/react-native-testing
Command: npx skills add https://github.com/bidah/react-native-hifi --skill react-native-testing-bidah

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Helps developers avoid flaky or incorrect React Native component tests by offering version-aware guidance on queries, async handling, and interactions across RNTL v13 and v14.

Core Features & Use Cases

  • Version detection and setup: Determine whether the project uses @testing-library/react-native v13 (sync render) or v14 (async render) and ensure jest-expo presets or transforms match the React Native version.
  • Query and interaction rules: Prioritize getByRole, prefer userEvent over fireEvent, and apply the recommended Jest matchers to keep assertions clear and accessible.
  • Patterns and anti-patterns: Follow the included references to avoid waitFor misuse, missing awaits in v14, and other pitfalls so your component tests stay stable across releases.

Quick Start

Ask the skill to review your component test file and enforce React Native Testing Library best practices for queries, assertions, and async handling.

Frequently Asked Questions about react-native-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix flaky React Native Testing Library tests caused by missing awaits?

Flaky React Native component tests usually stem from missing awaits in RNTL v14 async render or waitFor misuse. Apply version-aware guidance to fix async flows, ensure correct query priority, and match jest-expo presets to your React Native version.

What is the difference between React Native Testing Library v13 and v14?

React Native Testing Library v13 uses synchronous render, while v14 uses asynchronous render. This version difference dictates how you handle async flows, await missing errors, and manage query priority rules in Expo component test files.

Should I use userEvent or fireEvent for React Native component tests?

Prefer userEvent over fireEvent for React Native component tests to simulate realistic user interactions. Following this best practice alongside accessible query rules like getByRole keeps your assertions clear and stable across releases.

How do I set up jest-expo presets for React Native testing?

To set up jest-expo presets for React Native testing, ensure the transforms match your React Native version. Determine whether your project uses RNTL v13 or v14 and configure the preset accordingly to enable accurate component test execution.

Why does waitFor misuse cause React Native testing failures?

WaitFor misuse causes React Native testing failures by incorrectly timing async assertions and interactions. Avoiding this anti-pattern, along with applying recommended Jest matchers and version-specific async behavior rules, keeps your component tests stable across releases.

What are the best query priority rules for React Native Testing Library?

The best query priority rules for React Native Testing Library prioritize getByRole to keep assertions accessible and clear. Applying these rules, along with recommended Jest matchers, ensures your component test files remain stable and maintainable.