JSPM

  • Created
  • Published
  • Downloads 6416815
  • Score
    100M100P100Q219161F
  • License Apache 2.0

A jest result processor that generates junit xml files

Package Exports

  • jest-junit

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jest-junit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

jest-junit

A Jest testResultsProcessor that creates compatible junit xml files

Installation

yarn add --dev jest-junit

Usage

In your jest config add the following entry:

{
  "testResultsProcessor": "./node_modules/jest-junit"
}

Then simply run:

jest

Configuration

jest-junit offers two configurations based on environment variables.

JEST_SUITE_NAME: Default "jest tests"

JEST_JUNIT_OUTPUT: Default "./junit.xml"

Example:

JEST_SUITE_NAME="Jest JUnit Unit Tests" JEST_JUNIT_OUTPUT="./artifacts/junit.xml" jest

Example output:

<testsuites name="Jest JUnit Unit Tests">
  <testsuite name="My first suite" tests="1" errors="0" failures="0" skipped="0" timestamp="2016-11-19T01:37:20" time="0.105">
    <testcase classname="My test case" name="My test case" time="6">
    </testcase>
  </testsuite>
</testsuites>