Detox + Jest
Follow this guide to enable integrating Detox + Jest with Currents
Detox is a popular gray-box end-to-end testing and automation framework for React Native apps.
Detox delegates scheduling and running tests onto a test runner. Jest is the default and the recommended choice, for many reasons, including - but not limited to, parallel test suite execution capability, and complete integration with Detox API.
Currents integration with Jest allows sending the results of your Detox tests to Currents.
Add Currents Reporter for Jest
After you setup and configure Detox for your mobile application, add @currents/jest reporter to jest.config.js
Run Detox Tests
Run detox tests:
Running this command with @currents/jest reporter enabled generates results in a format compatible for processing by Currents.
In order to send the results for processing you'd invoke an additional command currents upload
from @currents/cmd npm package.
Uploading Results to Currents
Run the following command to upload the results to Currents (see currents upload for details)
Before running currents upload
you must explicitly define detox configuration that matches the configuration used to run the tests.
For example, if you run the tests using --configuration android.emu.release
, then you should also define the same configuration value for currents upload
command.
Without specifying the configuration, you may encounter an error:
Setting Detox Configuration
To explicitly set Detox configuration set the selectedConfiguration: <configuration key>
in the Detox config file:
If you have only one configuration value in the configurations
object of detox configuration file, Detox will pick it by default and there's no need to explicitly set the configuration.
The currents upload
command will execute jest
to discover the full test suite. During this process, the globalSetup
script will be run, which can only utilize the selectedConfiguration
option or the single value from the configurations
object.
Last updated