Skip to content

Aimed at making it easier to build Jenkins compatible JUnit XML reports in plugins for testing frameworks

License

Notifications You must be signed in to change notification settings

meuserj/junit-report-builder

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

junit-report-builder

Build Status Dependency Status devDependency Status

A project aimed at making it easier to build Jenkins compatible XML based JUnit reports.

Installation

To install the latest version, run:

npm install junit-report-builder --save

Usage

var builder = require('junit-report-builder');

// Create a test suite
var suite = builder.testSuite().name('My suite');

// Create a test case
var testCase = suite.testCase()
  .className('my.test.Class')
  .name('My first test');

// Create another test case which is marked as failed
var testCase = suite.testCase()
  .className('my.test.Class')
  .name('My second test')
  .failure();

builder.writeTo('test-report.xml');

This will create test-report.xml containing the following:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="My suite">
    <testcase classname="my.test.Class" name="My first test"/>
    <testcase classname="my.test.Class" name="My second test">
      <failure/>
    </testcase>
  </testsuite>
</testsuites>

If you want to more than one report, just create new builder instances by calling builder.newBuilder().

License

MIT

Changelog

1.0.0

  • Simplified API by making the index module export a builder instance

0.0.2

  • Corrected example in readme

0.0.1

  • Initial release

About

Aimed at making it easier to build Jenkins compatible JUnit XML reports in plugins for testing frameworks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CoffeeScript 59.4%
  • JavaScript 40.6%