1. Habit
  2. Skills
  3. React Native Testing skill
callstack · 5K installs

React Native Testing skill
Runs by itself, a component changes.

Keep React Native components covered.

Install the React Native Testing skill and make it a habit: follow https://gethabit.dev/skills/callstack/react-native-testing.md

  1. 1Copy
  2. 2Paste into Claude Code, Codex or Cursor
  3. 3It runs by itself

5K installs3K starsMIT licenceSource on GitHub ↗

React Native Testing

by callstack · 5K installs

The skill

The react native testing skill writes and fixes component tests with React Native Testing Library v13 and v14: render and screen, query priority, Jest matchers, userEvent, fireEvent, waitFor and async patterns.

Only when you ask.

The habit

Keep React Native components covered.

↻ Runs by itselfa component changes

How the habit works.
You don't have to.

Three questionsWhen does it start? How does it check its work? What does it remember?

One run, step by step.
Then it stops.

Stop ruleStops after the changed components and 2 fix rounds per run.

  1. 01

    Detect the version

    Your agent reads @testing-library/react-native from package.json.

  2. 02

    Load the reference

    It loads references/api-reference-v14.md or references/api-reference-v13.md.

  3. 03

    Write queries

    It uses screen with getByRole first and getByTestId last.

  4. 04

    Simulate use

    It uses userEvent, with fireEvent only for unsupported events and fake timers for presses.

  5. 05

    Check anti-patterns

    It compares the tests to references/anti-patterns.md.

  6. 06

    Run tests

    It runs the tests and fixes failures.

What it may do.
Nothing more.

Safe by defaultIt writes only in its own folder and asks you before anything goes out.

Is it for you?
Use it when it fits.

Quick checkRead both lists. If the left one sounds like you, the React Native Testing skill helps.

Use it when

  • ✓ You write React Native component tests
  • ✓ You fix failing RNTL tests
  • ✓ You migrate tests to RNTL v14

Skip it when

  • – You test React web components
  • – You run end-to-end device tests

Questions

React Native Testing skill, answered.

Is render async?

In v14 it is async; in v13 it is sync.

Why does getByRole not find my View?

A View needs accessible set to true, or use Pressable.

How do I install the React Native Testing skill?

Copy the prompt at the top into your agent. It installs the skill from callstack/react-native-testing-library and sets up the habit. Or run npx skills add callstack/react-native-testing-library --skill react-native-testing.

Is the React Native Testing skill free?

Yes. It is published under MIT. Habit is free too.

React Native Testing. Now as a habit.

Install the React Native Testing skill and make it a habit: follow https://gethabit.dev/skills/callstack/react-native-testing.md

  • Free
  • No account
  • Undo in one line

All callstack skills →More code skills →

Works in

  • Claude Code
  • Codex
  • Cursor
  • ChatGPT
  • Claude app

Made by callstack, published under MIT. Habit links to the original and never changes it. Is this your skill?

Copying didn't work here. Select the line and copy it by hand.