While there's only one de facto testing framework for E2E tests for JavaScript (Cucumber), there are several popular testing frameworks for unit and integration tests, namely Jasmine (jasmine.github.io), Mocha (mochajs.org), Jest (jestjs.io), and AVA (github.com/avajs/ava).
We will be using Mocha for this book, but let's understand the rationale behind that decision. As always, there are pros and cons for each choice:
- Maturity: Jasmine and Mocha have been around for the longest, and for many years were the only two viable testing frameworks for JavaScript and Node. Jest and AVA are the new kids on the block. Generally, the maturity of a library correlates with the number of features and the level of support.
- Popularity: Generally, the more popular a library is, the larger the community, and the higher likelihood of receiving support when...