--- name: react-native-testing description: Master testing - Jest, Testing Library, Detox E2E, and CI/CD integration sasmp_version: "1.3.0" bonded_agent: 06-react-native-testing bond_type: PRIMARY_BOND version: "2.0.0" updated: "2025-01" --- # React Native Testing Skill > Learn comprehensive testing strategies including unit tests, component tests, and E2E tests. ## Prerequisites - React Native basics - Understanding of async/await - Familiarity with testing concepts ## Learning Objectives After completing this skill, you will be able to: - [ ] Configure Jest for React Native - [ ] Write component tests with Testing Library - [ ] Mock native modules and APIs - [ ] Implement E2E tests with Detox/Maestro - [ ] Set up CI/CD test pipelines --- ## Topics Covered ### 1. Jest Setup ```javascript // jest.config.js module.exports = { preset: 'react-native', setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect'], transformIgnorePatterns: [ 'node_modules/(?!(react-native|@react-native)/)', ], }; ``` ### 2. Component Testing ```tsx import { render, screen, fireEvent } from '@testing-library/react-native'; import { Button } from './Button'; describe('Button', () => { it('calls onPress when pressed', () => { const onPress = jest.fn(); render(