detox-json-reporter

npm license build

πŸ“˜ View Documentation on GitHub Pages

detox-json-reporter

πŸ“Š A lightweight, TypeScript-powered JSON reporter for Detox end-to-end testing with Jest.

Generates structured detox-results.json files for analysis, dashboards (Grafana, Prometheus), or custom test pipelines.


✨ Features


πŸš€ Installation

yarn add -D detox-json-reporter
# or
npm install --save-dev detox-json-reporter

πŸ›  Usage

➀ Option 1: Use in jest.config.js

Add the reporter to your Jest configuration:

module.exports = {
  reporters: [
    'default',
    ['detox-json-reporter', {
      outputFile: './reports/detox-results.json' // optional path
    }]
  ]
};

This will generate a file at ./reports/detox-results.json after running your Detox tests.

➀ Option 2: Use via Detox config (.detoxrc.js or package.json)

{
  "detox": {
    "testRunner": "jest",
    "runnerConfig": "e2e/config.json",
    "reportSpecs": true,
    "reporter": "detox-json-reporter"
  }
}

This will instruct Detox to use the reporter automatically.


πŸ“„ Output Format Example

[
  {
    "testName": "Login flow should succeed",
    "status": "passed",
    "duration": 1325,
    "file": "e2e/Login.test.ts",
    "startedAt": "2025-06-26T10:25:00.123Z",
    "endedAt": "2025-06-26T10:25:01.448Z",
    "failureMessages": [],
    "retries": 1,
    "flaky": false,
    "environment": {
      "platform": "ios",
      "hostPlatform": "darwin",
      "hostname": "MacBook-Pro.local",
      "osVersion": "24.1.0",
      "cpuArch": "arm64"
    }
  }
]

πŸ“Š Use Cases


πŸ‘€ Author

FΓ‘bio Gomes - @fabiobhz


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE for details.