nanotest
simplest API for support,
- test(): for write test syncronous.
- test(done): for write test asyncronous.
- assert.count(): for auto count of executed assert count.
how to use
API
pass the function with asserts to test()
.
;
get the done
from test()
and use it for async test.
;
nanotest injects assert.count()
and count up assert called count.
and you can check that count with assert.count()
.
;
test with sync
call assert.count
var test = ;var assert = ; // group { // countup assert; };
test with async
var test = ;var assert = ; { // shorter than previous ; } { // interval var c = 0; var id = ; } { // immediate ; } { // nextTick process; } { // count up assert;};
Author
The MIT License (MIT) Copyright (c) 2013 Jxck