Getting Started

In Node.js

Getting Started in Node.js

In the browser

Getting Started in the browser

Guides

Check these QUnit tutorials and examples, to make the most of your unit tests!

  1. QUnit.module: How to group related tests.
  2. QUnit.test: Define tests, How to wait for async code.
  3. Fixture feature: Keeping your DOM tests atomic.
  4. Step API: Testing asynchronous callbacks or event listeners.
  5. Assertions: Partial object comparison, expected exceptions, and much more.
  6. Browser: Productivity tricks, Browser automation, What can the toolbar do?
  7. CLI: Productivity tricks, Code coverage.
  8. Reporter API: Event emitter, Create your own reporter.
  9. Theme API: Create your own theme.

Compatibility

QUnit supports the following runtime environments:

Desktop and mobile browser support
QUnit 1QUnit 2QUnit 3QUnit 3 (ESM)
Internet ExplorerIE 6-11IE 9-11—
Microsoft Edge1+15+[?]16+
Firefox3.6+45+60+
Safari4.0+9.1+10.1+
Mobile Safari (iOS)4.0+7.0+10.3+
Chrome1+58+61+
Chrome Mobile—49+ (Android 4.4+)61+ (Android 7+)
Opera11+36+48+
Android Browser2.3 - 5.04.3 - 5.0—

QUnit can also be run in a sandboxed iframe (since 2.2), and in Web Worker threads (since 2.3).

Server runtime support
QUnit 1QUnit 2QUnit 3QUnit 3 (ESM)
PhantomJS1.x—
Node.js—10+18+
SpiderMonkey (mozjs)—68+[?]

You can download QUnit 1.x and QUnit 2.x from the release archives.

Support

To report a bug, request a new feature, or ask a question open an issue on GitHub.

You can also find support on StackOverflow. Use the “qunit” hashtag on StackOverflow to search existing questions or ask your own question.

Chat

If you need help, or want to participate in sharing and discussing ideas, join us in the chat room on Matrix at #qunitjs_qunit:gitter.im:

Social media

Follow us:

Hashtags:


Linting

The eslint-plugin-qunit package has a variety of rules available for enforcing best testing practices as well as detecting broken tests.


Download

These are the official release channels for QUnit releases:


Further reading