Extensions

Bundled Addons

QUnit includes a few addons in its repository. These add custom assertions, running multiple testsuite from one, help with continous integration and provide alternative themes.

  • Canvas - provides a pixelEqual assertion, useful when working with a canvas element
  • Close Enough - provides close and notClose assertions, useful when testing approximate number values
  • Composite - bundle multiple testsuites intp a single file, running them in an br
  • JUnit Logger - produces JUnit-style XML output for test results, for integration into tools like Jenkins
  • PhantomJS Runner - a runner for PhantomJS, providing console output for tests. If you're using grunt, use its qunit task instead.
  • Step - adds a QUnit.step method that allows you to assert the proper sequence in which the code should execute.
  • Themes - alternative themes, load their CSS file instead of the default one.

Third-Party Extensions and integrations

If you prefer BDD-style APIs for testing, check out SpecIt and Pavlov. For testing ajaxy code, check mockjax and sinon.js. That and more below.

  • SpecIt A QUnit-based API for bdd-style testing
  • Pavlov - extends QUnit with a rich, higher-level, Behavioral API
  • Rails plugin for QUnit integration
  • jQuery-Mockjax - Interface to mock ajax requests and responses
  • Sinon.js integration with QUnit
  • QUnit testrunner plugin for JsTestDriver
  • Drupal module for QUnit
  • QUnit CLIB - QUnit CLIB helps extend QUnit's CLI support to many common CLI environments.