Skip to content

orangebeard-io/jest-listener

Repository files navigation

Orangebeard.io Jest Listener
Orangebeard.io Jest Listener

Orangebeard listener for the Javascript Jest unit test framework.

NPM Version Build Status

Installation

Install the npm package

npm install --save-dev @orangebeard-io/jest-listener

Configuration

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

{
    "jest": {
        ...
        "reporters": ["default","@orangebeard-io/jest-listener"],
        ...
    }
}

For projects with Create-React-App the above Jest config doesn't work. You should edit the test command in the package.json like this:

...
  "scripts": {
    ...
    "test": "react-scripts test --reporters=default --reporters=@orangebeard-io/jest-listener",
    ...
  },
...

Create a new file named orangebeard.json in the project root folder, next to package.json. Add the following entry:

{
  "endpoint": "https://app.orangebeard.io/[ORGANIZATION]",
  "token": "[LISTENER TOKEN]",
  "project": "example-project",
  "testset": "Jest Test set",
  "description": "Jest run",
  "attributes": [
    {
      "key": "Tool",
      "value": "Jest"
    }
  ],
  "referenceUrl": "https://docs.orangebeard.io/"
}

It's good practice to omit the token from the json file and get it from your env:

Windows cmd:

set orangebeard_token=[LISTENER TOKEN]

Linux/Mac:

export orangebeard_token=[LISTENER TOKEN]

Environment properties

Properties can also be set in the build, by passing them as environment variables.
It's important to mention that environment variables have precedence over the orangebeard.json definition.

$ export ORANGEBEARD_ENDPOINT=https://app.orangebeard.io/[ORGANIZATION]
$ export ORANGEBEARD_TOKEN=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
$ export ORANGEBEARD_PROJECT=example_project
$ export ORANGEBEARD_TESTSET=Jest testset
$ export ORANGEBEARD_DESCRIPTION=My awesome testrun
$ export ORANGEBEARD_ATTRIBUTES=key:value; value;

About

Orangebeard listener for the Javascript Jest unit test framework

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors