npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

junit-report-builder

v3.2.1

Published

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

Downloads

1,972,001

Readme

junit-report-builder

Build Status Weekly Downloads

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 tests="2" failures="1" errors="0" skipped="0">
  <testsuite name="My suite" tests="2" failures="1" errors="0" skipped="0">
    <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 create another report file, start by getting a new builder instance like this:

builder = builder.newBuilder();

Please refer to the e2e_spec.coffee for more details on the usage.

License

MIT

Changelog

3.2.1

  • Update documentation.

3.2.0

  • Support name and test count attributes for the root test suites element. Thanks to Simeon Cheeseman.
  • Describe parameter types and return types with JSDoc. Thanks to Simeon Cheeseman.

3.1.0

  • Add support for generic properties for test cases. Thanks to Pietro Ferrulli.
  • Bump dependencies

3.0.1

  • Bump dependencies: lodash, make-dir, date-format, minimist

3.0.0

  • Properly prevent invalid characters from being included in the XML files.
  • Dropped support for node.js 4 and 6

2.1.0

  • Added support for adding a file attribute to a test case. Thanks to Ben Holland.

2.0.0

  • Replace mkdirp by make-dir to resolve npm advisory 1179.
  • Dropped support for node.js 0.10.x and 0.12.x

1.3.3

  • Updated lodash to a version without known vulnerabilities.

1.3.2

  • Added support for emitting the type attribute for error and failure elements of test cases
  • Added support for emitting cdata/content for the error element of a test case

Thanks to Robert Turner.

1.3.1

  • Update dependencies to versions without known vulnerabilities.

1.3.0

1.2.0

  • Support creating XML with emojis. Thanks to ischwarz.

1.1.1

  • Changed date-format to be a dependency. Previously it was incorrectly set to be a devDependency. Thanks to georgecrawford.

1.1.0

  • Added attributes for test count, failure count, error count and skipped test count to testsuite elements
  • Added ability to attach standard output and standard error logs to test cases
  • Added ability set execution time for test suites
  • Added ability set timestamp for test suites

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