jest-mocha-reporter

A reporter for jest which produces a report compatible with Atlassian Bamboo Mocha Test Parser.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
jest-mocha-reporter
1.0.14 years ago4 years agoMinified + gzip package size for jest-mocha-reporter in KB

Readme

jest-mocha-reporter
A reporter for jest which produces a report compatible with Atlassian Bamboo Mocha Test Parser.
This is compatible with both reporter and testResultsProcessor
See Reporters
See testResultsProcessor
Build Status

Forked From

- Forked from [jest-bamboo-formatter](https://github.com/adalbertoteixeira/jest-bamboo-formatter)

Installation

~sh npm install --save-dev jest-mocha-reporter ~

Usage

In the jest config file add the path to the module.
If you are using testResultsProcessor:
~json {
"testResultsProcessor": "jest-mocha-reporter"
}
~
If you are using Reporters:
~json {
"reporter": "jest-mocha-reporter"
}
~
See Configuring Jest.

Configuration

The name of test suite and separator can be customized by setting the environment variables
~sh JESTMOCHASUITENAME="{fileNameWithoutExtension}" JESTMOCHANAMESEPARATOR=" >> " jest ~
JEST_MOCHA_SUITE_NAME supports following variables
  • firstAncestorTitle: The name of the outermost "describe" group
  • filePath: Full path of the test
  • fileName: File name of the test
  • fileNameWithoutExtension: File name of the test without extension

Also, variable supports fallback. For example: {firstAncestorTitle|filename} means use file name of the test if it doesn't have a group name.

Output

By default, the reporter writes to test-report.json. The file name can be changed by setting the JEST_REPORT_FILE environment variable.
~sh JESTREPORTFILE="./jest-report.json" jest ~

License

MIT