Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Write and run tests for React Native apps using Jest and React Native Testing Library. Use when creating tests, debugging failures, or setting up test infrastructure.
.claude/skills/aiskillstore-mobile-testing/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 36% | 0% |
| case-23 | ✓→✓ | = Same ✓ | 21% | 0% |
| case-24 | ✓→✓ | = Same ✓ | 35% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 15% | 0% |
Testing guide for React Native applications.
bash# Install testing dependencies npm install --save-dev jest @testing-library/react-native # Add to package.json { "scripts": { "test": "jest", "test:watch": "jest --watch", "test:coverage": "jest --coverage" } }
typescriptimport { render, fireEvent } from '@testing-library/react-native'; import { MyButton } from './MyButton'; describe('MyButton', () => { it('renders correctly', () => { const { getByText } = render(<MyButton title="Click me" />); expect(getByText('Click me')).toBeTruthy(); }); it('calls onPress when pressed', () => { const onPress = jest.fn(); const { getByText } = render( <MyButton title="Click me" onPress={onPress} /> ); fireEvent.press(getByText('Click me')); expect(onPress).toHaveBeenCalledTimes(1); }); });
typescriptimport { renderHook, act } from '@testing-library/react-native'; import { useCounter } from './useCounter'; describe('useCounter', () => { it('increments count', () => { const { result } = renderHook(() => useCounter()); act(() => { result.current.increment(); }); expect(result.current.count).toBe(1); }); });
typescriptimport { formatDate } from './formatDate'; describe('formatDate', () => { it('formats date correctly', () => { const date = new Date('2025-01-15'); expect(formatDate(date)).toBe('2025-01-15'); }); it('handles invalid input', () => { expect(() => formatDate(null)).toThrow(); }); });
typescriptjest.mock('expo-notifications', () => ({ scheduleNotificationAsync: jest.fn(), }));
typescriptjest.mock('@/db/client', () => ({ db: { select: jest.fn(), insert: jest.fn(), }, }));
typescriptjest.mock('expo-router', () => ({ useRouter: () => ({ push: jest.fn(), back: jest.fn(), }), }));
bash# Run all tests npm test # Watch mode (auto-rerun on changes) npm run test:watch # With coverage report npm run test:coverage # Run specific test file npm test -- MyComponent.test.tsx # Update snapshots npm test -- -u
testID for Selection: More reliable than text matchingbeforeEach/afterEach for setup/teardowntypescriptit('loads data', async () => { const { findByText } = render(<DataComponent />); expect(await findByText('Loaded')).toBeTruthy(); });
typescriptit('validates input', () => { const { getByTestId, getByText } = render(<LoginForm />); fireEvent.changeText(getByTestId('email-input'), 'invalid'); fireEvent.press(getByTestId('submit-button')); expect(getByText('Invalid email')).toBeTruthy(); });
typescriptit('renders list items', () => { const items = [{ id: '1', name: 'Item 1' }]; const { getAllByTestId } = render(<ItemList items={items} />); expect(getAllByTestId('list-item')).toHaveLength(1); });
screen.debug() to see rendered outputwaitFor or findBy queries| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-23 | pass→pass | 23,040 | 22,100 | -4% | 1 | 1 | 0% | 3,135 | 3,809 | +21% | 0 | 0 | — |
case-24 | pass→pass | 24,100 | 22,619 | -6% | 1 | 1 | 0% | 2,945 | 3,970 | +35% | 0 | 0 | — |
case-01 | pass→pass | 19,047 | 13,978 | -27% | 1 | 1 | 0% | 2,684 | 3,074 | +15% | 0 | 0 | — |
case-02 | pass→pass | 15,602 | 6,607 | -58% | 1 | 1 | 0% | 2,184 | 2,430 | +11% | 0 | 0 | — |
case-03 | pass→pass | 22,583 | 10,093 | -55% | 1 | 1 | 0% | 1,976 | 2,016 | +2% | 0 | 0 | — |
case-04 | pass→pass | 13,271 | 5,163 | -61% | 1 | 1 | 0% | 1,711 | 2,072 | +21% | 0 | 0 | — |
case-05 | pass→pass | 45,187 | 18,448 | -59% | 1 | 1 | 0% | 2,614 | 3,859 | +48% | 0 | 0 | — |
case-06 | pass→pass | 21,885 | 17,182 | -21% | 1 | 1 | 0% | 2,911 | 3,214 | +10% | 0 | 0 | — |
case-07 | fail→pass | 19,019 | 12,444 | -35% | 1 | 1 | 0% | 2,632 | 2,486 | -6% | 0 | 0 | — |
case-08 | pass→pass | 14,919 | 13,491 | -10% | 1 | 1 | 0% | 1,909 | 2,641 | +38% | 0 | 0 | — |
case-09 | pass→pass | 17,430 | 6,666 | -62% | 1 | 1 | 0% | 2,350 | 2,395 | +2% | 0 | 0 | — |
case-10 | pass→pass | 5,019 | 7,568 | +51% | 1 | 1 | 0% | 866 | 1,626 | +88% | 0 | 0 | — |
case-11 | pass→pass | 10,745 | 7,839 | -27% | 1 | 1 | 0% | 929 | 1,624 | +75% | 0 | 0 | — |
case-12 | pass→pass | 6,227 | 3,608 | -42% | 1 | 1 | 0% | 1,082 | 1,712 | +58% | 0 | 0 | — |
case-13 | pass→pass | 14,886 | 12,169 | -18% | 1 | 1 | 0% | 1,825 | 2,543 | +39% | 0 | 0 | — |
case-14 | pass→pass | 13,630 | 11,835 | -13% | 1 | 1 | 0% | 1,632 | 2,436 | +49% | 0 | 0 | — |
case-15 | pass→pass | 16,816 | 12,264 | -27% | 1 | 1 | 0% | 2,037 | 2,763 | +36% | 0 | 0 | — |
case-16 | pass→pass | 13,618 | 11,568 | -15% | 1 | 1 | 0% | 1,652 | 2,246 | +36% | 0 | 0 | — |
case-17 | fail→pass | 20,925 | 19,950 | -5% | 1 | 1 | 0% | 2,663 | 3,626 | +36% | 0 | 0 | — |
case-18 | pass→pass | 15,203 | 13,272 | -13% | 1 | 1 | 0% | 1,665 | 2,345 | +41% | 0 | 0 | — |
case-19 | pass→pass | 3,540 | 2,669 | -25% | 1 | 1 | 0% | 674 | 1,577 | +134% | 0 | 0 | — |
case-20 | pass→pass | 7,158 | 7,076 | -1% | 1 | 1 | 0% | 388 | 1,545 | +298% | 0 | 0 | — |
case-21 | pass→pass | 19,983 | 18,649 | -7% | 1 | 1 | 0% | 2,857 | 3,916 | +37% | 0 | 0 | — |
case-22 | pass→pass | 22,759 | 19,443 | -15% | 1 | 1 | 0% | 3,481 | 3,865 | +11% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +8 percentage points is the difference between those two pass rates over the 24 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.