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

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

BabelJS

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

Enjoy the show


Please Consider Sharing This Post:

FacebooktwitterredditlinkedinFacebooktwitterredditlinkedin