0.1.1 • Published 12 years ago
minitestwrap v0.1.1
#minitestwrap
I like using Node's assert
library but I often wish it had just a little bit more to it, so I wrote this tiny wrapper around it. See the below example for usage.
var minitestwrap = require("./minitestwrap");
var assert = require("assert");
minitestwrap.beforeEach(function() {
console.log("before each");
});
minitestwrap.beforeAll(function() {
console.log("before all");
});
minitestwrap.afterEach(function() {
console.log("after each");
});
minitestwrap.afterAll(function() {
console.log("after all");
});
minitestwrap.addTest("check 2+2", function() {
assert.equal(2+2, 4);
});
minitestwrap.addTest("Check true is true", function() {
assert.equal(true, true);
});
minitestwrap.run();
If you'd like a proper example, I use the library in my NodeFetch project.
And here's how it looks: