Back to Qunit

Index

docs/index.md

2.26.02.2 KB
Original Source
<section class="grid grid--small home-highlights"> <div> <h2>Easy</h2> <p>Easy, zero configuration setup for any Node.js project and minimal configuration for Browser-based projects.</p> </div> <div> <h2>Universal</h2> <p>QUnit can run anywhere; web browsers, Node, SpiderMonkey, even in a Web Worker! Test your code where it runs.</p> </div> <div> <h2>Extensible</h2> <p>Flexible APIs for custom assertions, runners, and reporters mean you can extend QUnit to fit your needs.</p> </div> </section>

A Quick Example

js
function add (a, b) {
  return a + b;
}

QUnit.module('add', hooks => {
  QUnit.test('two numbers', assert => {
    assert.equal(add(1, 2), 3);
  });
});
<div class="grid grid--split" markdown="1"> <div class="example-result" markdown="1">

Browser Result

<iframe loading="lazy" title="The example test code running in the browser" src="/resources/example-add.html"></iframe> </div> <div class="example-result" markdown="1">

CLI Result

tap
TAP version 13
ok 1 add > two numbers
1..1
# pass 1
# skip 0
# todo 0
# fail 0
</div> </div>

Current Release

<p class="lead lead--center">v2.21.0 (<a href="https://github.com/qunitjs/qunit/blob/2.21.0/History.md">changelog</a>)</p>

These are the officially supported release channels for QUnit:


Join the Community

<p class="lead lead--center" markdown="1">Join us on [Mastodon](https://fosstodon.org/@qunit), [Twitter](https://twitter.com/qunitjs), or [Gitter chat](https://gitter.im/qunitjs/qunit).</p>

To contribute:


<p class="cta">What are you waiting for? <a href="{% link intro.md %}" class="button">Get started!</a></p>