Mocha

Mocha (JavaScript framework)

Mocha JS is an automated Javascript testing framework for Nodejs/Meteor JS. Mocha makes asynchronous code testing simpler, extensible and fast. Mocha runs the test in sequence and resulted in flexible and accurate reporting while mapping uncaught exceptions to the correct test cases. It also featured in test coverage reports, and use of any assertion library.

Mocha is written in Javascript. It's free and open source framework and licensed under MIT License. Mocha is used for unit and combination testing and it is a great candidate for BDD (Behavior Driven Development). Mocha was released on 22nd Nov 2011 but its recent stable version Mocha 4.0.1 was released on 5th Oct, 2017.

Mocha can be used with most JavaScript assertion libraries, including: should.js, express.js, chai, better-assert, unexpected. When using Mocha these are the choices for assertion but Chai tends to be the most popular. Mocha does not come with a test double library, Sinon.js is the actual choice in Mocha. Sinon is a very powerful test double library. Mocha comes with a command line utility that developer can use to run tests.