unit testing node.js code example
Example 1: how to run mocha tests form a file
$ mocha -g 'logs a'
Example 2: node test unit
var assert = require('assert');
describe('Array', function() {
describe('#indexOf()', function() {
it('should return -1 when the value is not present', function() {
assert.equal([1, 2, 3].indexOf(4), -1);
});
});
});