fixed lib/mocha.js. Added test