Karma vs The Intern

I have worked hard to make testing part of my regular development workflow. I believe in order for something to become part of your way of getting things done it needs to be easy and fun! You need to set yourself up for success by investing a little bit of time into a system that works for you.

In the past testing any type of JavaScript has been a huge pile of hacks! Normally it would be a single HTML page with a test runner which you refreshed to run your tests. It was better than nothing, but it was far from automated.

When NodeJS showed up and became popular I started to build my modules in a way where there was very little knowledge of the web browser or DOM APIs so that I could run tests quickly from the command line. This was a little better than the single HTML page approach, and also had the side effect of forcing me to create a barrier between the view and the meat of my application logic. But I still needed that single HTML page to run tests against my views.

Then came the JS test runners! These runners basically automate interactions with the browser and collect test results for you. They allow you to run your tests across many different browsers at the same time. All of the runners have their pros and cons. I am setting up a repo to do a side by side comparison of two runners that I am familiar with. The repo is comparing Karma and The Intern. I am familiar with Karma I have been using it daily for well over a year and its pretty awesome! I am still in the evaluation phase with The Intern, but I like the support it has for a more functional style of testing.

You can follow along with the progress here!

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

%d bloggers like this: