Socket
Socket
Sign inDemoInstall

qunit-reporter-junit

Package Overview
Dependencies
140
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    qunit-reporter-junit

Produce JUnit-style XML test reports with QUnit.


Version published
Weekly downloads
7.9K
decreased by-50.22%
Maintainers
1
Install size
23.2 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 16 Oct 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc