Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@seadub/danger-plugin-junit

sgtcoolguy898MIT0.3.0TypeScript support: included

Add your Junit XML test failures to Danger

danger, danger-plugin, junit

readme

danger-plugin-junit

Build Status npm version

Add your Junit XML test failures to Danger

Usage

Install:

npm install danger-plugin-junit --save-dev
# or
yarn add danger-plugin-junit --dev

At a glance:

// dangerfile.js
import junit from 'danger-plugin-junit'

async function main() {
    await junit({ pathToReport: './build/reports/**/TESTS*.xml' })
}

main()
    .then(() => process.exit(0))
    .catch(err => {
        fail(err.toString());
        process.exit(1);
    });

The default pathToReport value is './build/reports/**/TESTS*.xml' The value is a glob string to gather up test result files.

This plugin will only report test failures and errors. If any tests fail, it will report a single fail() message and record a table of the failed tests using markdown().

An example of what is produced is below:

Changelog

See the GitHub release history.

Contributing

See CONTRIBUTING.md.

changelog

0.3.0 (2021-08-30)

Features

  • allow calling warn instead of fail for failed tests (775937e)

0.2.0 (2020-07-14)

Bug Fixes

  • handle gathering count of skipped tests when suite doesn't provide count (69c5dfb)

Features

  • allow setting a custom header name (237c402)