
React Native Harness
- 59 installs
- 325 repo stars
- Updated August 4, 2026
- callstackincubator/react-native-harness
react-native-harness is a Claude skill that routes into the react-native-harness CLI to write and debug on-device React Native tests, including mocks, spies, and optional UI tests.
About
This skill is a router for writing and debugging React Native Harness tests for app code. It defers to the version-matched harness CLI, reading skill guides via harness skill get. It covers mocking modules, spying on functions, rendering React Native components on-device, setupFiles configuration, and optional UI tests with @react-native-harness/ui. A developer uses it when creating or fixing tests that import from react-native-harness.
- Router into the react-native-harness CLI for writing and debugging on-device React Native tests
- Requires react-native-harness >= 1.3.0-rc.1 and reads version-matched CLI skill guides
- Covers mocking modules, spying, rendering components on-device, and optional UI tests
React Native Harness by the numbers
- 59 all-time installs (skills.sh)
- Ranked #1,165 of 2,153 Testing & QA skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
react-native-harness capabilities & compatibility
Free; requires the react-native-harness CLI of version 1.3.0-rc.1 or newer.
- Capabilities
- testing · on device testing · test writing · mocking
- Use cases
- testing
- Pricing
- Free
What react-native-harness says it does
Write and debug React Native Harness tests for app code.
Require `react-native-harness >= 1.3.0-rc.1`; older CLIs lack these skill commands.
Use this skill only to route into version-matched CLI guidance.
npx skills add https://github.com/callstackincubator/react-native-harness --skill react-native-harnessAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 59 |
|---|---|
| repo stars | ★ 325 |
| Last updated | August 4, 2026 |
| Repository | callstackincubator/react-native-harness ↗ |
What it does
Write or fix on-device React Native Harness tests, including module mocks, spies, and optional UI tests.
Who is it for?
Authoring or fixing on-device React Native Harness tests using version-matched CLI guidance.
Skip if: Use with a CLI older than 1.3.0-rc.1, since those lack the skill commands.
When should I use this skill?
When asked to create or fix tests that import from react-native-harness, mock modules, spy on functions, or render RN components on-device.
What you get
Correct react-native-harness tests that mock modules, spy on functions, and render components on-device.
- react-native-harness tests
- module mocks and spies
- optional UI tests
By the numbers
- requires react-native-harness >= 1.3.0-rc.1
Files
Router only. Private setup before using this skill:
harness --versionRequire react-native-harness >= 1.3.0-rc.1; older CLIs lack these skill commands. If older, run npm install -g react-native-harness@latest, recheck, then continue. If you cannot upgrade, stop and tell the user. Do not include version or upgrade commands in final plans.
Before your first Harness command or plan, read the version-matched CLI guide:
harness skill get coreIf you need more details on Harness, see the available CLI skill guides:
harness skill listLoad additional skills via harness skill get <name> when needed.
Use this skill only to route into version-matched CLI guidance. Let the installed CLI skill files provide exact workflow guidance, API usage, and current test-writing rules.
Installation And Setup
Use this reference only when the task involves installing, configuring, or running React Native Harness.
Install
Install the main package:
npm install --save-dev react-native-harnessMost projects should also install the platform packages they plan to run:
@react-native-harness/platform-android@react-native-harness/platform-apple@react-native-harness/platform-web
If the user wants UI queries, interactions, or screenshots, also install:
@react-native-harness/ui
For iOS and Android, adding @react-native-harness/ui requires rebuilding the app because it includes debug-only native code.
Recommended Bootstrap
Prefer the setup wizard first:
npx react-native-harness@latest initThe wizard can generate:
rn-harness.config.mjsjest.harness.config.mjs- platform package setup
Minimal Config Expectations
rn-harness.config.mjs should define:
entryPointappRegistryComponentNamerunners- optional
defaultRunner
Typical runner guidance:
- Android: configure
androidPlatform(...)withandroidEmulator(...)orphysicalAndroidDevice(...) - iOS: configure
applePlatform(...)withappleSimulator(...)orapplePhysicalDevice(...) - Web: configure
webPlatform(...)with a browser helper likechromium(...)
jest.harness.config.mjs should normally use:
export default {
preset: 'react-native-harness',
};Common additions:
testMatchfor**/*.harness.[jt]s?(x)setupFilessetupFilesAfterEnv
Writing Tests
Author tests in files like:
feature.harness.tsfeature.harness.tsx
Import public test APIs from react-native-harness.
Running Tests
Run one runner at a time:
npx react-native-harness --harnessRunner android
npx react-native-harness --harnessRunner ios
npx react-native-harness --harnessRunner webHelpful supported Jest-style flags include:
--watch--coverage--testNamePattern
If defaultRunner is configured in rn-harness.config.mjs, the runner flag can be omitted.
Environment Notes
- Harness runs tests in the app or browser environment, not plain Node.
- The app must already be built and installed for native runners.
- Web tests require the target web app dev server to be running.
- Harness can reset the environment between test files by restarting the app when configured with the default isolation behavior.
Setup Files Guidance
Use setupFiles for early polyfills and globals.
Use setupFilesAfterEnv for:
afterEach(...)clearAllMocks()resetModules()- shared Harness mocks
UI Testing Notes
Use @react-native-harness/ui for:
screenuserEvent- screenshot testing
If screenshots need content outside normal screen bounds, mention disableViewFlattening: true in rn-harness.config.mjs.