Coswell Productions

Fast JavaScript and CoffeeScript Unit Testing with jasmine-headless-webkit

I use Jasmine to do all of my JavaScript testing, but I didn't like the existing methods of running the tests for various reasons:

  • Reloading the rake jasmine server in a browser is slow
  • The Jasmine CI solution uses Selenium, which is equally as slow
  • I could never get Node.js to play nicely with jQuery and all the associated bits
  • Other headless JavaScript solutions took too long to start up and get running

Eventually, I got sick of it and took Sencha Labs' basic specrunner and turned it into jasmine-headless-webkit, a very fast, Jasmine server configuration-compatible headless WebKit runner. Qt WebKit runners are all the rage since Qt 4.7 make WebKit so easily available (capybara-webkit is another awesome testing project using the widget).

This one is focused solely on running Jasmine as easily and as quickly as possible. It also has some real nice bells and whistles:

  • It has its own per-project configuration for choosing configs, toggling color output, and debug output
  • It can compile and run CoffeeScript alongside your plain old JavaScript
  • It can integrate with Autotest (though if you're also doing RSpec testing in the same project, use watchr and this script)

Hop over to the GitHub project to learn more. It's really easy to use. If you've already set up your project with the Jasmine gem, you're good to go with jasmine-headless-wekbit.

See what else is here...