Mocha
Mocha is a JavaScript test framework for Node.js programs eaturing browser support, asynchronous testing, test coverage reports, and use of any assertion library. Source
Chai
Chai is a BDD/TDD assertion library for node and the browser that can be delightfully paired with any javascript testing framework. Chai has three interfaces: should , expect and assert, you can choose which one you want to use.
Why did I choose Mocha and Chai?
I had no idea about what test framework was the better for the project so I started to look for information about test frameworks, mainly Mocha and Jest. I saw a couple of tutorials about Mocha and Chai, like this one and I realised that it was really easy to use.
- Reasons why I am using Mocha and Chai
You have to indicate the test route in package.json and to run it use:
$ npm test
Installation
- To install them as a dependecy:
$ npm install --save-dev mocha chai
If you want to install them globally you can do it with:
$npm install --global mocha chai