Skip to content

Instantly share code, notes, and snippets.

@fitzgen
Created July 16, 2010 19:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitzgen/478793 to your computer and use it in GitHub Desktop.
Save fitzgen/478793 to your computer and use it in GitHub Desktop.
var
test = test || null,
ok = ok || null,
deepEqual = deepEqual || null,
assert = null;
// If we are not running in Qunit in the browser, create a shim from the Qunit API
// to the CommonJS API.
if (typeof exports !== "undefined") {
assert = require("assert");
test = function (msg, fn) {
if (typeof fn === "number") {
fn = arguments[2];
}
exports[msg] = fn;
};
ok = assert.ok;
deepEqual = assert.deepEqual;
}
// ... Snip ...
// Run the Common JS Test Runner
if (typeof exports !== "undefined") {
require("os").exit(require("test").run(exports));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment