Why I Am Switching to Karma


JavaScript testing is hard. Most of the time, it is just plain difficult to set up the test harness just to run Javascript tests.


Most of my team’s existing production web applications do not use any MV* frameworks. A few newer projects use Backbone/Marionette.

We rely on the following stack:-

We choose this direction because these Maven plugins provide good integration with Jenkins.

What is Wrong with the Current State


We will now rely on the following stack:-

Why This is a Better State

  • Developed by Google developers, primary test harness for AngularJS.
  • Allows us to use Jasmine 2.x.
  • Test framework agnostic. Although we are using Jasmine now, we can easily switch to Mocha in the future.
  • MV* framework agnostic. It works with any MV* or homegrown framework.
  • Great integration with Jenkins.
  • Great integration with IntelliJ.
  • Ability to run tests on different browsers at the same time, such as Chrome, Firefox, PhantomJS, etc.


  1. Prashanth says:


    Thanks for your post. I have some question regarding your initial project setup. We have exactly same setup as yours in the first case where we are using phantomjs driver with jasmine and we want to enable code coverage for the same using “code saga” plugin. But, whatever we tried, we are not able to succeed. Could you please send me the part of pom.xml where this coverage and jasmine is configured?


Leave a Reply

Your email address will not be published. Required fields are marked *