Skip to content

Instantly share code, notes, and snippets.

@cadorn
Created February 12, 2011 00:07
Show Gist options
  • Save cadorn/823315 to your computer and use it in GitHub Desktop.
Save cadorn/823315 to your computer and use it in GitHub Desktop.
Test with NodeUnit CommonJS Program
module.declare(["nodejs/path", "nodeunit/nodeunit"], function(require, exports, module)
{
var PATH = require("nodejs/path");
exports.main = function()
{
module.print("Hello World from NodeUnit Gist Test!\n");
var reporter = require("nodeunit/nodeunit").reporters["default"];
process.chdir(PATH.dirname(module.id));
reporter.run(['test.js']);
}
});
{
"uid": "https://gist.github.com/823315/",
"main": "main.js",
"engine": [
"node"
],
"mappings": {
"nodeunit": {
"archive": "https://github.com/caolan/nodeunit/zipball/0.4.0"
},
"nodejs": {
"id": "nodejs.org/"
}
}
}
{
"boot": "gist.github.com/823315/",
"engine": [
"node"
],
"packages": {
"gist.github.com/823315/": {
"locator": {
"location": "./"
}
},
"nodejs.org/": {
"provider": "nodejs.org/"
},
"github.com/caolan/nodeunit/zipball/0.4.0": {
"locator": {
"descriptor": {
"native": true
}
}
}
}
}
exports.testSomething = function(test){
test.expect(1);
test.ok(true, "this assertion should pass");
test.done();
};
exports.testSomethingElse = function(test){
test.ok(true, "this assertion should pass too");
test.done();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment