# React native testing

> React native testing is an open-source agent skill for developer tools. Guides writing React Native component tests with React Native Testing Library v13 and v14. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/callstackincubator/agent-skills/tree/main/plugins/vendored/.agents/skills/react-native-testing
- **Repository:** https://github.com/callstackincubator/agent-skills
- **GitHub stars:** 1,725
- **License:** MIT
- **Skill name:** react-native-testing
- **Collection:** https://github.com/callstackincubator/agent-skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill gives the agent a working guide for writing and fixing React Native component tests with @testing-library/react-native. It starts by checking the installed RNTL version in package.json, then loads the matching reference: v14 uses async render and test-renderer, while v13 uses sync render and react-test-renderer. The guide sets a query priority that favors accessible roles and labels over test IDs, explains the getBy, queryBy, findBy and getAllBy variants, and lists the Jest matchers available from RNTL.

The skill also covers interaction patterns. It recommends userEvent for presses, typing, clearing, pasting and scrolling, with fireEvent kept for events userEvent does not support. It sets rules such as preferring findBy over waitFor, keeping side effects out of waitFor, avoiding manual act and cleanup calls, and using fake timers with userEvent. A custom render example shows how to wrap tests in providers. Separate reference files and an anti-patterns list hold the full API details.

Users should have a React Native project using Jest with either RNTL v13 or v14 installed. The skill includes no scripts; it provides guidance that the agent applies to the project's own test files.

## When your agent uses it

> Write tests using React Native Testing Library (RNTL) v13 and v14 (`@testing-library/react-native`). Use when writing, reviewing, or fixing React Native component tests. Covers: render, screen, queries (getBy/getAllBy/queryBy/findBy), Jest matchers, userEvent, fireEvent, waitFor, and async patterns. Supports v13 (React 18, sync render) and v14 (React 19+, async render). Triggers on: test files for React Native components, RNTL imports, mentions of "testing library", "write tests", "component tests", or "RNTL".

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/callstackincubator/agent-skills/tree/HEAD/plugins/vendored/.agents/skills/react-native-testing)
- [License: MIT](https://github.com/callstackincubator/agent-skills/tree/HEAD/plugins/vendored/.agents/skills/react-native-testing)

## Features

- **Version-aware render guidance:** Chooses between the v13 sync and v14 async APIs based on the installed RNTL version.
- **Query priority rules:** Orders queries from accessible roles and labels down to test IDs as a last resort.
- **User interaction patterns:** Shows userEvent usage for press, long press, typing, clearing, pasting and scrolling.
- **Async assertion practices:** Recommends findBy queries over waitFor with getBy and explains waitFor limits.
- **Jest matcher reference:** Lists RNTL matchers for visibility, enabled state, text, style and accessibility checks.
- **Custom provider wrapper:** Demonstrates a render helper that wraps components in providers via the wrapper option.

## Good for

- Write component tests for a React Native screen
- Fix a failing test that uses waitFor incorrectly
- Migrate tests from fireEvent to userEvent
- Test a form with text input and a submit button
- Add provider wrapping to a custom render helper
- Review existing RNTL tests for anti-patterns

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/react-native-testing` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/callstackincubator/agent-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/react-native-testing &&
cp -R "$tmp/plugins/vendored/.agents/skills/react-native-testing" ~/.claude/skills/react-native-testing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/react-native-testing` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/react-native-testing` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/callstackincubator/agent-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/react-native-testing &&
cp -R "$tmp/plugins/vendored/.agents/skills/react-native-testing" ~/.agents/skills/react-native-testing &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/react-native-testing` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/react-native-testing` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/callstackincubator/agent-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/react-native-testing &&
cp -R "$tmp/plugins/vendored/.agents/skills/react-native-testing" ~/.cursor/skills/react-native-testing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/react-native-testing` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/callstackincubator/agent-skills.git --path plugins/vendored/.agents/skills/react-native-testing
```

Or copy the folder to `~/.gemini/skills/react-native-testing` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/react-native-testing`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/callstackincubator/agent-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/react-native-testing &&
cp -R "$tmp/plugins/vendored/.agents/skills/react-native-testing" ~/.copilot/skills/react-native-testing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/react-native-testing` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/callstackincubator/agent-skills.git
```

Then copy `agent-skills/plugins/vendored/.agents/skills/react-native-testing` into your agent's skills folder as `react-native-testing`. Agents that support SKILL.md read one folder per skill.

## FAQ

### How does the skill decide which RNTL API to use?

It checks the version of @testing-library/react-native in the project's package.json. v14 uses async APIs with test-renderer, and v13 uses sync APIs with react-test-renderer.

### Does React native testing run any scripts or change files?

No scripts are included. It is a set of written guidance and reference files that the agent follows when writing or reviewing tests.

### Which query should I use first?

The guide recommends getByRole with a name option first, then getByLabelText, getByPlaceholderText, getByText, getByDisplayValue, and getByTestId as a last resort.

### Is the skill open source?

The repository is listed under the MIT license.

### How do I install React native testing in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/react-native-testing to use it in all your projects, or to .claude/skills/react-native-testing in one project.

### Does React native testing run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use React native testing?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to React native testing?

The closest alternatives to React native testing are JavaScript TypeScript jest, Jest skill, React19 test patterns, React18 enzyme to rtl and Test authoring edho ferdian.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [JavaScript TypeScript jest](https://ai-powered.com/skills/javascript-typescript-jest): JavaScript TypeScript jest is an open-source agent skill for developer tools.
- [Jest skill](https://ai-powered.com/skills/jest-skill): Jest skill is an open-source agent skill for developer tools.
- [React19 test patterns](https://ai-powered.com/skills/react19-test-patterns): React19 test patterns is an open-source agent skill for developer tools.
- [React18 enzyme to rtl](https://ai-powered.com/skills/react18-enzyme-to-rtl): React18 enzyme to rtl is an open-source agent skill for developer tools.
- [Test authoring edho ferdian](https://ai-powered.com/skills/test-authoring-edho-ferdian): Test authoring edho ferdian is an open-source agent skill for developer tools.
- [React frontend](https://ai-powered.com/skills/react-frontend): React frontend is an open-source agent skill for developer tools.
- [React native best practices](https://ai-powered.com/skills/react-native-best-practices): React native best practices is an open-source agent skill for developer tools.
- [Vitest skill](https://ai-powered.com/skills/vitest-skill): Vitest skill is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/react-native-testing
