Your First Jest Run

Running Jest tests with Currents dashboard

Setting up Currents for running and recording Jest tests in parallel can be done seamlessly within a few minutes.

Prerequisites

Create an Organization and a Project

After signing up for the dashboard service, you will be prompted to create a new organization and a project. You can change their names later.

After creating a new organization and a project, you'll see on-screen instructions with your newly created Project ID and Record Key.

Select Jest from the framework selection list.

Install @currents/jest and @currents/cmd packages
npm install @currents/jest @currents/cmd --save-dev

Note: @currents/jest requires

  • Jest v29.5.0+

  • Node.js v18.20.4+

Use the Currents reporter

You have two options on how to use our reporter.

Option 1: Update Jest configuration file:

jest.config.js
import type { Config } from "jest";

const config: Config = {
  reporters: ["default", "@currents/jest"], // Add this line to your config
};

export default config;

Option 2: Pass our reporter as an argument when executing Jest.

package.json
{
  ...
  "scripts": {
    ...
    "test": "jest --reporters=@currents/jest",
  },
  ...
}
Update your .gitignore

Add a line in your .gitignore to avoid pushing temporary generated reports to your repository.

.currents

Create your first Jest run

Every time you run Jest, Currents will generate a temporary report folder with the test results. For this data to be uploaded to your dashboard, you must run the @currents/cmd utility.

Step 1: Run the tests

npx jest --reporters=@currents/jest

Step 2: Upload the results

Run our utility command to upload the last results to the dashboard.

npx currents upload --key=XXX --project-id=YYY

Set the Record Key, and Project ID obtained from Currents dashboard in the previous step.

You can also setup the Record Key and Project ID in the Reporter configuration.

Explore your first run

If everything was set up correctly, the execution results will show on the Currents dashboard. The latest report should be uploaded to Currents, and a link to the run will be displayed.

Explore

Learn more about our dashboard and its features.

Last updated