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 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-jqunit

v1.1.9

Published

An XUnit unit testing framework (in the style of JUnit) for node.js, using QUnit as the underlying engine

Downloads

280

Readme

node-jqunit - A JavaScript Unit Testing framework

The XUnit testing style (first seen in JUnit and the like) is a popular style for writing test fixtures. node-jqunit is a port of this idiom to JavaScript for use within the node.js server-side JavaScript framework. It uses Fluid's infusion framework for resolution of global names. Currently the majority of the implementation of jqUnit itself is also within the infusion module. This implementation itself is layered on top of the popular QUnit framework.

We traditionally name node-jqunit's global as jqUnit (which is not a valid npm module name as it contains a capital letter).

Running a test fixture file

To run a file containing test fixtures, simply execute it with node -

node fixtureFile.js

Writing a test fixture file

To write a fixture file, begin with

var fluid = require("infusion");
var jqUnit = fluid.require("node-jqunit", require, "jqUnit");

You may use also use plain "require" to load jqUnit, although it is essential that it itself may resolve the Fluid framework (infusion).

Then begin by starting a "module" and then issue some tests:

jqUnit.module("My Module");

jqUnit.test("My test case", function () {
    jqUnit.assertTrue("I assert that this is true", true);
    }
);

Writing jqUnit tests

The documentation for jqUnit itself is in Infusion's documentation at jqUnit. All the assertions and helper functions described there are valid for use within node-jqunit if they do not refer to the browser or DOM nodes.

Running self-tests

The test cases for node-jqunit itself can be found in the test directory - instructions for running them are in their README