ReportPortal agent for the Javascript Jest unit test framework
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
constants Initial contribution of the Jest agent for ReportPortal (contributed … Nov 27, 2018
utils
LICENSE
README.md
index.js
package.json Initial contribution of the Jest agent for ReportPortal (contributed … Nov 27, 2018

README.md

reportportal-agent-jest

A Jest reporter that uploads the results to a ReportPortal server.

Installation

npm install --save-dev reportportal-agent-jest

Usage

In your jest config section of package.json, add the following entry:

{
    "jest": {
        ...
        "reporters": [
            "reportportal-agent-jest",
            {
                "endpoint": "https://your.reportportal.server/api/v1",
                "project": "YourReportPortalProjectName",
                "launchname": "YourLauncherName",
                "tags": ["Ninja","MyOtherCoolTag"]
            }
        ],
        ...
    }
}

First configure your ReportPortal access token, then start Jest:

$ export RP_TOKEN=<your_secure_token>
$ jest

It's also possible to override parameters launchname and project defined in package.json by using environment variables, it's important to mention that environment variables has precedence over package.json definition.

$ export RP_LAUNCH_NAME=MY_COOL_LAUNCHER
$ export RP_PROJECT_NAME=MY_AWESOME_PROJECT

This for your convenience in case you has a continuous job that run your tests and may post the results pointing to a different Report Portal definition of project or launcher name.

Copyright Notice

Licensed under the Apache License v2.0

This code is based on the jest-junit but adapted by team members of Ontoforce for the ReportPortal upload. Ontoforce contributed this effort as Open Source to the ReportPortal project team.