When comparing Yeoman vs Mocha, the Slant community recommends Mocha for most people. In the question“What are the best tools for front-end JavaScript development?” Mocha is ranked 2nd while Yeoman is ranked 6th. The most important reason people chose Mocha is:
Mocha runs independently from the [assertion library](http://visionmedia.github.io/mocha/#assertions), so you can choose which assertion format works best for you. Mocha most often is run in combination with assertion library [Chai](http://chaijs.com).
Ranked in these QuestionsQuestion Ranking
Pros
Pro Active community
Yeoman has an active community with new generators being created at a rapid pace. Because of the momentum behind the community, you can expect good support and adoption for new tools and frameworks promptly after they come out.
Pro Huge number of generators for scaffolding your project
Yeoman generators allow you to quickly set up a new project. Invoked with the scaffolding tool 'yo' they provide a boilerplate & tooling selection. There are over 1000 generators, including generators for ember, angular & backbone, to choose from, the majority of which are community maintained.
Pro Allows you to choose between different build systems
Yeoman supports both major build systems - Grunt and Gulp. These build systems will help you automate tasks such as minification & concatenation of files, running tests, deploying and live-updating your webpage among many others.
Pro Free and open source
Yeoman is free, open source and licensed under BSD.
Pro Support for the package manager of your choice
Yeoman supports both Bower and npm, and is flexible in regard to tools to allow it to work with a wider range of project requirements.
Pro Standardized workflow process
Yeoman wants webapp development to be more standardized under the "Yeoman workflow" banner. As such it encourages the use of a specific combination of tools - a scaffolding tool (yo), a build tool (grunt, gulp, etc) and a package manager (bower, npm).
Pro Generators can be composed with other generators
Yeoman's scaffolding system allows generators to rely on other generators allowing for better code reuse and standardization between generators that use a common sub-component.
Pro Cross-platform
As a command line tool it works on OS X, Linux & Windows.
Pro Works with the package manager directly
Yeoman doesn't just scaffold your project, but also helps you integrate with your package manager directly, so you can manage your entire project with it.
Pro Developers can create their own plugins
Developers can also create their own Yeoman generator which are practically plugins with which Yeoman works. Generators are basically Node.js modules and can be created just like any other Node module.
There is also a very detailed and useful guide on how to create a generator on the Yeoman official website.
Pro Supports different assertion libraries
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.
Pro Write tests with Behavior Driven Development (BDD)
Allows developers to choose their development process. Not only TDD but also BDD.
Pro Runs in Node.js and the browser
Mocha has a browser build as well as a node command line program so you can test in client and server side environments.
Pro Makes Asynchronous testing extremely easy
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.
Pro Integrates really well with NodeJS
The Mocha test framework itself runs on NodeJS, hence it makes everything related to it extremely simple. With Mocha's simple syntax and speed, testing your node.js app just got a whole lot easier.
Pro Custom full color test reporters
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.
Pro Easy to add support for Generators
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.
Cons
Con Combining Yeoman and backend frameworks can bring problems
Combining Yeoman and a backend framework such as Django, Rails or Laravel can create problem because the project structure of Yeoman may not be compatible with that of the backend project. It can be tuned to work but for small projects it can be relatively time consuming.
Con Can be intimidating for beginners
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.
Con No atomic tests
Tests cannot be ran in random order.