explaingit

wix/detox

11,908JavaScriptAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

An end-to-end testing framework for React Native apps on iOS and Android that writes tests in JavaScript and eliminates flaky test results by monitoring the app's internal state before each simulated user action.

Mindmap

mindmap
  root((Detox))
    What it does
      E2E mobile testing
      Simulates user actions
      Checks screen content
    Anti-flakiness
      Gray box testing
      Async monitoring
      Wait then act
    Platforms
      iOS simulator
      Android emulator
    CI Integration
      Travis CI
      CircleCI
      Jenkins
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Automate a login flow test on your React Native app that taps the email field, types credentials, taps Login, and asserts the home screen appears.

USE CASE 2

Run end-to-end tests on every pull request in a CI pipeline like GitHub Actions so regressions are caught before merging.

USE CASE 3

Replace manual QA tapping sessions on a device emulator with a scripted test suite that covers critical user journeys.

Tech stack

JavaScriptReact NativeJestiOSAndroid

Getting it running

Difficulty · moderate Time to first run · 30min

Requires Xcode for iOS or Android Studio for Android emulator setup alongside the Node.js test runner.

Free to use and modify for any purpose, including commercial projects, as long as you keep the MIT license notice.

In plain English

Detox is an end-to-end testing framework for mobile apps, built specifically for React Native projects that run on both Android and iOS. It lets developers write automated tests in JavaScript that interact with a real device or simulator the same way a person would, tapping buttons, typing text, and checking what appears on screen. The main problem Detox tries to solve is flakiness in automated tests. Flaky tests are ones that sometimes pass and sometimes fail for no obvious reason, making it hard to trust them. Detox addresses this by using a technique the team calls gray box testing: instead of treating the app as a black box and only poking at it from the outside, Detox can also monitor what is happening inside the app, particularly its asynchronous operations, which are background tasks that run after a user action. When the app is still busy internally, Detox waits before taking the next step, which removes the main cause of unpredictable test results. Because it is designed for continuous integration workflows, Detox works well in automated build pipelines like Travis CI, CircleCI, or Jenkins. Teams that ship mobile apps frequently and rely on automated checks rather than manual QA are the primary audience. Tests are written in JavaScript using an async/await style, meaning each step is written in sequence and the test pauses naturally until each action finishes. The framework works with Jest out of the box, though it is designed to be compatible with other test runners as well. The project is maintained by Wix and is released under the MIT license, meaning it is free to use and modify. The README is concise: it covers what Detox does, shows a short code sample of a login test, lists which React Native versions are officially supported, and points to a documentation site for full setup instructions.

Copy-paste prompts

Prompt 1
Write a Detox test in JavaScript that launches my React Native app, fills in an email and password on the login screen, taps the submit button, and asserts that a 'Welcome' text element is visible on the next screen.
Prompt 2
I'm setting up Detox with Jest on an existing React Native project. Walk me through the detox.config.js file I need and the npm scripts to add so I can run tests on the iOS simulator.
Prompt 3
My Detox tests keep failing intermittently with timeout errors. Explain how Detox's gray box synchronization works and what steps I can take to fix async timing issues.
Prompt 4
Show me how to integrate Detox into a GitHub Actions CI workflow that spins up an Android emulator and runs the full test suite on every PR.
Open on GitHub → Explain another repo

← wix on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.