npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

qunit-nodejs-ui

v0.0.2

Published

QUnit UI for tests run in Nodejs

Readme

Overview

Adds the functionality of the QUnit browser UI to QUnit tests run in Nodejs.

  • All tests that are run display in a list of accordions.
  • Passed and failed assertions are listed.
  • The Hide passed tests checkbox can be toggled to hide or show passed tests.
  • Refreshing the browser window reruns tests
  • Click the rerun link of any test to run it again.
  • Click the "Rerun failed tests" link after a test run completes to rerun all failed tests.
  • Use the QUnit modules dropdown to select any subset of test modules to run.
  • Use the filter input to run only tests where the module name and title match the string passed.
  • Applies the QUnit browser diff feature to show the diff between expectations and results where tests fail.

Additional features

  • Where the expectation or result of an assertion is valid HTML, it is rendered in the browser.
  • Adds copy buttons to the expectations and results of assertions.

How it works

An small express server starts both a web server and a UI.

The server opens a web socket connection which the UI joins.

Tests are run using the imported test runner module. This module sends data to the server when the QuUnit event callbacks occur, and the server forwards those to the UI.

Conversely, the UI sends a message back to the server to initiate a test run whenever the page is reloaded. The UI query params are included, which enables the implementation of features listed above.

Usage

npm install qunit-nodejs-ui

The server must be started from within the node_module.

cd ./node_modules/qunit-nodejs-ui/web-viewer
node qunit-web-server.js --test-runner-path="path-to-your-tests-file" --server-port=3002 --ui-port=8001

Both --server-port and ui-port are optional, and can be used to customise the ports on which the server and UI are served. Defaults to 3000 for the server and 8000 for the UI.

Tests file

The tests need to be defined as an array of objects as in the example below, rather than by calling the QUnit methods in the normal way, which looks like this: QUnit.module('My module', function () {...}

This is because the test runner needs to generate the unique hash for each test (A hash of the module concatenated with test name), in the same way the the QUnit browser code does.

The QUnit browser code adds these hashes to the url query params when we use UI controls to run specific tests or modules.

By passing the test runner an array of objects, as shown in testModules below, the test runner can determine the hashes of the tests and filter them appropriately.

Example

import { uiTestRunner } from 'qunit-nodejs-ui/web-viewer/utils/test-runner';

const testModules = [
  {
    moduleName: 'My module',
    tests: [
      {
        name: 'My test',
        fn: async (assert) => {
          assert.equal(1, 1);
        },
      },
    ],
  },
];

uiTestRunner(testModules);

Usage example

git clone [email protected]:andrew-paterson/qunit-nodejs-ui.git

npm install

cd usage-example

./start-qunit-web-server.sh

Visit http://localhost:8001

Refresh the page if the tests to not run immediately.