Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sscaff1/jest-xunit
An xunit reporter for jest
https://github.com/sscaff1/jest-xunit
Last synced: about 1 month ago
JSON representation
An xunit reporter for jest
- Host: GitHub
- URL: https://github.com/sscaff1/jest-xunit
- Owner: sscaff1
- Created: 2018-11-09T02:58:08.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-29T17:54:46.000Z (about 6 years ago)
- Last Synced: 2024-10-12T20:23:44.318Z (2 months ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-jest - jest-xunit
README
# Jest XUnit
jest-xunit is a reporter for Jest that produces an XML in xunit format.
## Installation
```
npm i -D jest-xunit
```Then in your jest config specify jest-xunit as a reporter:
```js
{
...
reporters: [
'default', // keep the default reporter
[
'jest-xunit',
{
traitsRegex: [
{ regex: /\(Test Type:([^,)]+)(,|\)).*/g, name: 'Category' },
{ regex: /.*Test Traits: ([^)]+)\).*/g, name: 'Type' }
]
}
]
]
...
}
```## Config
| configKey | Description | Default |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
| filename | The filename of the results. The reporter outputs xml format | test-results.xml |
| outputPath | The path where the test results should be generated. | process.cwd() |
| traitsRegex | An array of objects with the following keys: _ regex - A regex to be used to extract the traits _ name - The name of the extract trait type | [] |