JavaScript unit testing framework!!!
Keep it simple.
function test (name, fn) {
console.group(name);
fn(function () { console.assert.apply(console, arguments); });
console.groupEnd();
}
// Usage
test("My test", function (assert) {
assert(true, "Everything ok!");
});
Written by Jacob Rask
Related protips
1 Response
Better wrap that function call with a try/catch, or else you'll end up with a console.group that never ends!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#