react-native-testing
Installation
SKILL.md
React Native Testing
Priority: P1 (OPERATIONAL)
Setup
- Jest: Pre-configured in React Native.
- Testing Library: Use
@testing-library/react-nativefor user-centric tests. - Mocking: Use
jest.mock()for native modules.
Component Testing
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 });