Before diving deep into React Native Harness and introducing it into your project, it's important to understand when and why to use React Native Harness and how it compares with alternatives.
React Native Harness is a testing tool for testing native modules in their native environments (Android, iOS) in a convenient way, using well-known Jest/Vitest syntax. Unlike traditional Jest tests that run in Node.js without access to native functionality, Harness executes your tests directly on real devices and simulators where native modules are available.
For a detailed explanation of the problems with current testing approaches and how Harness solves them, see Problem Statement.
React Native Harness was designed to provide a way to conveniently test native modules without the need to implement a custom testing workflow with E2E tools like Maestro, which is usually cumbersome and not scalable.
Our approach:
React Native Harness should be used when you want to test your native modules or code that heavily relies on native modules. While it's not the best tool to test your application logic (Jest/Vitest are better for that), it can technically be used in those scenarios as well.
Use React Native Harness when:
Consider alternatives when:
For a detailed comparison of testing approaches and when to use each, see our Feature Comparison.
Ready to start testing native functionality the way it should be tested? Let's get React Native Harness set up in your project.