Back to skills
SKILL.md
React Native Testing
ASecurityJest and React Native Testing Library for component and integration tests. Use when writing Jest or React Native Testing Library tests for React Native components. (triggers: **/*.test.tsx, **/*.spec.tsx, __tests__/**, test, testing, jest, render, fireEvent, waitFor)
- 67 stars
- 0 votes
- 0 copies
- 0 views
- Added November 10, 2026
Security analysis
100/100npx -y skills add ComeOnOliver/skillshub --skill react-native-testing --agent claude-codeAre you the author of React Native Testing?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/comeonoliver-react-native-testing)---
name: react-native-testing
description: "Jest and React Native Testing Library for component and integration tests. Use when writing Jest or React Native Testing Library tests for React Native components. (triggers: **/*.test.tsx, **/*.spec.tsx, __tests__/**, test, testing, jest, render, fireEvent, waitFor)"
---
# React Native Testing
## **Priority: P1 (OPERATIONAL)**
## Setup
- **Jest**: Pre-configured in React Native.
- **Testing Library**: Use `@testing-library/react-native` for user-centric tests.
- **Mocking**: Use `jest.mock()` for native modules.
## Component Testing
```tsx
import { render, fireEvent, waitFor } from '@testing-library/react-native';
test('increments counter on button press', () => {
const { getByText, getByRole } = render(<Counter />);
const button = getByRole('button', { name: /increment/i });
fireEvent.press(button);
expect(getByText('Count: 1')).toBeTruthy();
});
```
## Async Testing
```tsx
test('fetches and displays data', async () => {
const { findByText } = render(<DataComponent />);
const element = await findByText(/loaded data/i);
expect(element).toBeTruthy();
});
```
## Best Practices
- **User-Centric**: Use `getByRole`, `getByText` over `testID` when possible.
- **Integration > Unit**: Test features, not implementation.
- **Avoid Snapshots**: Use sparingly. Brittle and hard to review.
- **Coverage**: Aim for 70%+. Focus on critical paths.
## Anti-Patterns
- **No Testing Implementation**: Test behavior, not internals.
- **No testID Overuse**: Prefer accessible queries.
## References
See [references/testing-library.md](references/testing-library.md) for RNTL setup, mocking providers, and integration flow examples.
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.