Aside from the numerous benefits with generators in your application, You can now also integrate generators into your test suite. By using mocha, all you have to do is enable support for generators.
Mocha has multiple test reporters built in and you can create your own as well. The test reporters have full color and makes it easy to see if your tests fail or not.
No need to write tricky statements for Async testing. Mocha gives you a done callback. Place this done parameter in your callback function, that'll let Mocha know that you've written an asynchronous function.
Mocha runs independently from the assertion library, so you can choose which assertion format works best for you.
Mocha most often is run in combination with assertion library Chai.
While some testing frameworks are complete out of the box, Mocha requires developers to select and set up assertion libraries and mocking utilities. For someone who is just starting to learn how to build tests this can be scary as they will also have to choose which libraries to use and learn them too.
Code readability is an important factor, if the application development involves multiple teams; if the testing team is unable to read your test cases then they won't be able to test it. Jasmine resolves this issue by providing developers with an extremely simple and "human-friendly" syntax.
EditComment References 1
Jasmine comes with everything already baked in (including assertion libraries and mocking utilities). While this is great for beginners and people who don't want to spend much time looking into different libraries and tools it can be a turnoff for anyone who wants to use a different assertion and/or mocking library.
All you have to do is to include the QUnit library either from the CDN or from the local server and then create your tesctases.js file and run it.
The outputs will be displayed in a nice format in the browser.
If you want your tests to run in the order you have provided (maybe if your tests are ordered in such a way that your current test relies on the previous one), you can do so by setting QUnit.config.reorder = false and the tests will run in the order that you have provided.
QUnit expects you to call start() before an async function and stop() once it has stopped. This can be problematic when you have no way of knowing when exactly your function will start or stop.