Zero configuration and setup for any Node.js project, and minimal setup for Browser-based projects.
QUnit can run anywhere; web browsers, Node, SpiderMonkey, even in a Web Worker! Test your code where it runs.
Flexible APIs for custom assertions, runners, and reporters mean you can extend QUnit to fit your needs.
function add (a, b) {
return a + b;
}
QUnit.module('add', (hooks) => {
QUnit.test('two numbers', (assert) => {
assert.equal(add(1, 2), 3);
});
});
TAP version 13
ok 1 add > two numbers
1..1
# pass 1
# skip 0
# todo 0
# fail 0
v2.24.1 (changelog)
These are the official release channels for QUnit:
qunit-2.24.1.js
and qunit-2.24.1.css
npm install --save-dev qunit
yarn add --dev qunit
Follow us on Mastodon or Bluesky
What are you waiting for? Get started!