Why I Am Switching to Karma

OVERVIEW

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

CURRENT STATE

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

FUTURE 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.
Advertisements

2 thoughts on “Why I Am Switching to Karma

  1. Prashanth

    Hi,

    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?

    Thanks,
    Prashanth

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s