qunit-reporter-junit
Produce JUnit-style XML test reports with QUnit.
Last updated 4 years ago by jamesmgreene .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install qunit-reporter-junit 
SYNC missed versions from official npm registry.

Build Status NPM version

JUnit Reporter for QUnit

A QUnit plugin that produces JUnit-style XML test reports (e.g. for integration into build tools like Jenkins).

Usage

New API

Include the plugin script ("qunit-reporter-junit.js") after the QUnit core script itself, then register callback(s) using jUnitDone to do something with the XML string (e.g. upload it to a server):

QUnit.jUnitDone(function(report) {
  if (typeof console !== 'undefined') {
    console.log(report.xml);
  }
});

With this new API (as of v1.1.0), you can even register a callback after the tests have finished and still successfully receive the data (so long as the "qunit-reporter-junit.js" script was included before the test run began).

Old API

The old API approach of implementing the jUnitReport hook is also still supported:

QUnit.jUnitReport = function(report) {
  if (typeof console !== 'undefined') {
    console.log(report.xml);
  }
};

With this old API, you MUST implement the callback before the tests have finished or else you will never receive the data.

Notes

If you're using Grunt, you should take a look grunt-contrib-qunit.

Current Tags

  • 1.1.1                                ...           latest (4 years ago)

4 Versions

  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 13
This Month 63
Last Day 2
Last Week 30
Last Month 58
Dependencies (0)
None
Dev Dependencies (7)

Copyright 2014 - 2016 © taobao.org |