Skip to content

feat: add junit formatter #2121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CONTRIBUTING.md) on how to contribute to Cucumber.

## [Unreleased]
### Added
- Add new JUnit formatter ([#2121](https://github.com/cucumber/cucumber-js/pull/2121))

## [8.5.2] - 2022-08-24
### Added
Expand Down
4 changes: 4 additions & 0 deletions docs/formatters.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ Outputs details of the test run in the legacy JSON format.

*Note: this formatter is in maintenance mode and won't have new features added to it. Where you need a structured data representation of your test run, it's best to use the `message` formatter. Tools that rely on this formatter will continue to work, but are encouraged to migrate to consume the `message` output instead.*

### `junit`

The JUnit formatter produces a XML based JUnit report.

### `snippets`

The Snippets Formatter doesn't output anything regarding the test run; it just prints [Snippets to implement any undefined steps](./snippets.md). This is useful when you want to quickly zero in on the steps you have to implement and grab the snippet code for them in one go.
Expand Down
110 changes: 110 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
"tmp": "^0.2.1",
"util-arity": "^1.1.0",
"verror": "^1.10.0",
"xmlbuilder": "^15.1.1",
"yup": "^0.32.11"
},
"devDependencies": {
Expand All @@ -241,6 +242,7 @@
"@microsoft/api-extractor": "7.28.7",
"@sinonjs/fake-timers": "9.1.2",
"@types/chai": "4.3.1",
"@types/chai-xml": "^0.3.2",
"@types/dirty-chai": "2.0.2",
"@types/express": "4.17.13",
"@types/fs-extra": "9.0.13",
Expand All @@ -263,6 +265,7 @@
"@typescript-eslint/parser": "5.32.0",
"chai": "4.3.6",
"chai-exclude": "2.1.0",
"chai-xml": "^0.4.0",
"coffeescript": "2.7.0",
"dependency-lint": "7.1.0",
"dirty-chai": "2.0.1",
Expand Down
2 changes: 2 additions & 0 deletions src/formatter/helpers/formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import SummaryFormatter from '../summary_formatter'
import UsageFormatter from '../usage_formatter'
import UsageJsonFormatter from '../usage_json_formatter'
import HtmlFormatter from '../html_formatter'
import JunitFormatter from '../junit_formatter'

const Formatters = {
getFormatters(): Record<string, typeof Formatter> {
Expand All @@ -23,6 +24,7 @@ const Formatters = {
summary: SummaryFormatter,
usage: UsageFormatter,
'usage-json': UsageJsonFormatter,
junit: JunitFormatter,
}
},
buildFormattersDocumentationString(): string {
Expand Down
Loading