QUnitX — universal test library that runs the same test file in Node.js, Deno, and browser.

Wraps QUnit's assertion API over each runtime's native BDD test runner so you only write your tests once.

Examples

Example 1

import { module, test } from "qunitx";

module("Math", (hooks) => {
  hooks.before((assert) => assert.step("setup"));

  test("addition", (assert) => {
    assert.equal(1 + 1, 2);
  });

  test("async", async (assert) => {
    const n = await Promise.resolve(42);
    assert.strictEqual(n, 42);
  });
});