1.1.9 • Published 3 years ago

node-jqunit v1.1.9

Weekly downloads
69
License
BSD-3-Clause
Repository
github
Last release
3 years ago

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

1.1.9

3 years ago

1.1.8

6 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

8 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago