Socket
Socket
Sign inDemoInstall

node-jqunit

Package Overview
Dependencies
Maintainers
9
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-jqunit

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


Version published
Maintainers
9
Created
Source

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

Keywords

FAQs

Package last updated on 31 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc