Easy
Zero configuration and setup for any Node.js project, and minimal setup for Browser-based projects.
Universal
QUnit can run anywhere; web browsers, Node, SpiderMonkey, even in a Web Worker! Test your code where it runs.
Extensible
Flexible APIs for custom assertions, runners, and reporters mean you can extend QUnit to fit your needs.
A Quick Example
function add (a, b) {
return a + b;
}
QUnit.module('add', (hooks) => {
QUnit.test('two numbers', (assert) => {
assert.equal(add(1, 2), 3);
});
});
Browser Result
CLI Result
TAP version 13
ok 1 add > two numbers
1..1
# pass 1
# skip 0
# todo 0
# fail 0
Current Release
v2.22.0 (changelog)
These are the official release channels for QUnit:
- Download:
qunit-2.22.0.js
andqunit-2.22.0.css
- npm:
npm install --save-dev qunit
- Yarn:
yarn add --dev qunit
Join the Community
Join us on Mastodon, Twitter, or Matrix chat.
To contribute:
- Watch the repository to learn about release, new requests, or bug reports.
- The source of this website, is in the “docs/” directory.
What are you waiting for? Get started!