npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

detox-rp-reporter

v1.1.1

Published

Jest custom reporter for integrating Detox E2E tests with ReportPortal analytics and reporting

Downloads

225

Readme

detox-rp-reporter

npm version License: MIT Node.js

A Jest reporter that integrates Detox mobile testing framework with ReportPortal for comprehensive test reporting and analytics.

Features

  • ReportPortal Integration: Uploads test results directly to ReportPortal
  • Artifact Support: Automatically attaches screenshots and videos from failed tests
  • Offline Mode: Run tests without real-time reporting - cache and upload later
  • Always-Cache Mode: Commands cached in memory for reliable reporting
  • TypeScript Support: Built with TypeScript for better developer experience

Installation

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

Configuration

Environment Variables

export RP_ENDPOINT=https://your-reportportal-instance.com
export RP_API_KEY=your-api-key
export RP_PROJECT_NAME=your-project-name
export RP_LAUNCH=your-launch-name
export DETOX_ARTIFACTS_PATH=.artifacts

Jest Configuration

module.exports = {
  reporters: [
    'default',
    ['detox-rp-reporter', {
      endpoint: process.env.RP_ENDPOINT,
      apiKey: process.env.RP_API_KEY,
      project: process.env.RP_PROJECT_NAME,
      launch: process.env.RP_LAUNCH,
      artifactsPath: process.env.DETOX_ARTIFACTS_PATH,
      attributes: [
        { key: 'framework', value: 'detox' },
        { key: 'platform', value: 'mobile' }
      ]
    }]
  ]
};

Usage

Once configured, the reporter automatically:

  • Creates a launch in ReportPortal when Jest starts
  • Tracks test execution and creates test items
  • Attaches screenshots and videos from failed tests
  • Completes the launch when all tests finish

Artifact Handling

The reporter automatically searches for and attaches artifacts from failed tests:

  • Screenshots: testFnFailure.png from failed test artifacts
  • Videos: test.mp4 from failed test recordings

Artifacts are searched in the Detox artifacts directory structure:

.artifacts/
└── ✗ Login Screen should login with valid credentials/
    ├── testFnFailure.png
    └── test.mp4

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | endpoint | string | - | ReportPortal endpoint URL | | apiKey | string | - | ReportPortal API key | | project | string | - | ReportPortal project name | | launch | string | - | Launch name | | description | string | - | Launch description | | mode | string | DEFAULT | Launch mode | | artifactsPath | string | .artifacts | Path to Detox artifacts | | attributes | array | [] | Launch attributes | | extendTestDescriptionWithLastError | boolean | true | Include error details in test description | | skippedIssue | boolean | true | Mark skipped tests as issues | | offlineMode | boolean | false | Enable offline mode - cache only, no real-time reporting | | saveToFile | boolean | true | Save cached commands to file | | cacheFilePath | string | ./rp-cache.json | Path to cache file | | launchId | string | - | Existing launch ID to append results | | rerun | boolean | false | Rerun mode | | rerunOf | string | - | UUID of launch to rerun |

Cache and File Save Mode

The reporter operates in always-cache mode, storing all commands in memory for reliable reporting. By default, commands are also saved to a file for debugging and offline replay capabilities.

Offline Mode

When you need to run tests without real-time ReportPortal connectivity:

{
  "reporters": [
    ["detox-rp-reporter", {
      "offlineMode": true,  // Disable real-time reporting
      "saveToFile": true,   // Save commands to cache file
      "cacheFilePath": "./rp-cache.json",
      // ... other options
    }]
  ]
}

After running tests in offline mode, upload results with the generated replay script:

node ./rp-replay.js

For comprehensive offline mode documentation, see OFFLINE_MODE_USAGE.md.

Requirements

  • Node.js 18.x or higher
  • Yarn 4.x or higher
  • Jest for test running
  • Detox for mobile testing framework integration
  • ReportPortal instance for test reporting

Development

Building the Project

# Install dependencies
yarn install

# Build the project
yarn build

# Run linting
yarn lint

# Format code
yarn format

Project Structure

src/
├── index.ts              # Main export
├── DetoxReporter.ts      # Core reporter implementation
├── AsyncQueue.ts         # Async operation queue
├── Storage.ts           # Internal storage utility
├── helper/
│   └── OfflineMod.ts    # Offline mode helper utilities
└── types/
    └── reportportal.d.ts # ReportPortal type definitions

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Issues

If you encounter any issues, please report them on GitHub Issues.

Support

For questions and support, please contact:

License

MIT - see the LICENSE file for details.

Acknowledgments