@colorfy-software/detoxify
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

🧪 Detoxify

Useful helpers for E2E testing in React Native with Detox.

Current GitHub Actions build status. Current npm package version. PRs welcome!

🎯 Purpose

Detox is a library that provides gray box end-to-end testing and automation for React Native apps. Detoxify has been built on top of it to provide a useful set of tools to make that experience even more delightful.

🏗️ Installation

yarn add @colorfy-software/detoxify

Also install and set up:

  1. detox
  2. jest

💻 Usage

Setup

// ./e2e/environment.js

const DetoxHelpers = require('@colorfy-software/detoxify')
const { DetoxCircusEnvironment, SpecReporter, WorkerAssignReporter } = require('detox/runners/jest-circus')

class CustomDetoxEnvironment extends DetoxCircusEnvironment {
  constructor(config, context) {
    super(config, context)

    // 👇👇👇
    DetoxHelpers.init({
      translations: require('../src/locales/en.ts'),
      // optional
      // runOnly: []
    })
    // 👆👆👆

    // Can be safely removed, if you are content with the default value (=300000ms)
    this.initTimeout = 300000

    // This takes care of generating status logs on a per-spec basis. By default, Jest only reports at file-level.
    // This is strictly optional.
    this.registerListeners({
      SpecReporter,
      WorkerAssignReporter,
    })
  }
}

module.exports = CustomDetoxEnvironment

Use cases

Content coming soon.

🤝 Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

💖 Code of Conduct

This library has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

📰 License

detoxify is licensed under the MIT License.

Package Sidebar

Install

npm i @colorfy-software/detoxify

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

71.7 kB

Total Files

9

Last publish

Collaborators

  • colorfy-software