React Native Testing

Writes, reviews, and debugs React Native component tests using React Native Testing Library (RNTL) versions 13 and 14.

This Claude Code skill optimizes your AI assistant for writing, refactoring, and troubleshooting component tests in React Native applications. By analyzing your package.json, the skill automatically detects whether your project utilizes React Native Testing Library (RNTL) v13 (React 18 sync render) or v14 (React 19 async render), applying correct testing patterns, query priorities, async userEvent flows, and Jest matchers while strictly avoiding common testing anti-patterns.

主要功能

01Validates test structures to prevent common anti-patterns like nesting side-effects in waitFor.
02Optimizes user interaction testing utilizing modern, async userEvent APIs over legacy fireEvent.
03Detects and supports RNTL v13 (sync render) and v14 (async render) based on your project configuration.
041,522 GitHub stars
05Enforces strict query priority starting with accessible, role-based queries (getByRole).
06Applies specialized React Native Jest matchers for cleaner, more readable assertions.

使用场景

01Writing robust, accessible unit and integration tests for new React Native components.
02Debugging and fixing flaky or failing async tests, timing issues, and render cycles.
03Upgrading legacy test suites during a React Native or React Native Testing Library migration.