Day 3 – Unit Testing JavaScript with Karma and Mocha

Karma, Karma, Karma, Chameleon

That’s right, we are adding culture to our project this week. Test Driven Development culture that is. In the video below we add Karma, Mocha, Chai, Browserify, Watchify, and BabelJS to the project.


Karma is a continuous test runner for JavaScript unit tests.

Mocha and Chai

Mocha is a unit testing framework for Javascript and Chai is an assertion library.

Browserify and Watchify

In the context of what we are doing today, Browserify and Watchify are used by Karma to detect changes and bundle the javascript for testing


We use Babelify to transpile the ES2015 JavaScript into ES5 JavaScript.

Enjoy the show

Clayton has been programming professionally since 2005 doing mostly web development with an emphasis on JavaScript and C#. He has a focus Software Craftsmanship and is a signatory of both the Agile Manifesto and the Software Craftsmanship manifesto. He believes that through short iterations and the careful gathering of requirements that we can deliver the highest quality and the most value in the shortest time. He enjoys learning and encouraging other to continuously improve themselves.

Please Consider Sharing This Post: