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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@npmcitteam/reportportal-agent-jest

v1.0.9

Published

A Jest reporter that uploads test results to ReportPortal

Downloads

1

Readme

reportportal-agent-jest

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

Installation

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

Usage

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

{
    "jest": {
        ...
        "reporters": [
            "default",
            ["@reportportal/reportportal-agent-jest",
            {
                "token": "00000000-0000-0000-0000-000000000000",
                "endpoint": "https://your.reportportal.server/api/v1",
                "project": "YourReportPortalProjectName",
                "launch": "YourLauncherName",
                "description": "YourDescription",
                "attributes": [
                    {
                        "key": "YourKey",
                        "value": "YourValue"
                    },
                    {
                        "value": "YourValue"
                    },
                ]
            }]
        ],
        ...
    }
}

In case you use jest.config.js, you should add to it the following:


module.exports = {
    ...
    reporters: [
        "default",
        [
            "@reportportal/reportportal-agent-jest",
            {
                "token": "00000000-0000-0000-0000-000000000000",                
                "endpoint": "https://your.reportportal.server/api/v1",
                "project": "YourReportPortalProjectName",
                "launch": "YourLauncherName",
                "description": "YourDescription",
                "attributes": [
                    {
                        "key": "YourKey",
                        "value": "YourValue"
                    },
                    {
                        "value": "YourValue"
                    },
                ]
            }
        ]
    ]
    ...

It's possible by using environment variables, it's important to mention that environment variables has precedence over package.json definition.

$ export RP_TOKEN=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
$ export RP_PROJECT=MY_AWESOME_PROJECT
$ export RP_LAUNCH=MY_COOL_LAUNCHER
$ export RP_ATTRIBUTES=key:value,key:value,value

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, launcher name or tags.

Disable the colors of test output:

In the Report Portal, the output of the test results may contain ANSI character set, this may be caused by the color setting in Jest. For version "jest": "^24.8.0", use jest --no-colors command to disable the colors of test output.

Used to report retry of test:

The agent supports of Retries. Read more about retries in jest.

Rerun:

To report rerun to the report portal you need to specify the following options:

  • rerun - to enable rerun
  • rerunOf - UUID of launch you want to rerun. If not specified, report portal will update the latest launch with the same name

Example:

"rerun": true,
"rerunOf": "f68f39f9-279c-4e8d-ac38-1216dffcc59c"

Skipped issue:

Default: true. ReportPortal provides feature to mark skipped tests as not 'To Investigate' items on WS side. Parameter could be equal boolean values: TRUE - skipped tests considered as issues and will be marked as 'To Investigate' on Report Portal. FALSE - skipped tests will not be marked as 'To Investigate' on application.

Example:

"skippedIssue": false

Run test example:

Go to the example folder and inside of jest.config.js you need to insert data about your instance of the Report Portal.

To run the tests, type the following command in the console:

npm run test

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.