If you write jasmine specs within your rails app you probably know, that
rake jasmine will start a webrick server serving your jasmine test suite under localhost:8888. You also probably know that you also can run your test suite using a selenium driver with the
rake jasmine:ci command. This will start a server, spawn of a firefox instance that navigates to the test suite and after it has run, it will tell in your console if it failed or succeeded.
Making it headless
But running firefox is slow. You really want to use a headless browser for testing it. It's also good for jenkins (or any other continuous integration system). So, why not use PhantomJS?
You do not know how?
Well, I didn't really do either, until yesterday when a colleague finally looked into the jasmine-gem code. It's simple (but undocumented), so here it goes:
Install PhantomJS and then add a file called
Jasmine.configure do |config|
config.browser = :phantomjs
s it. Just runrake jasmine:ci` and see for yourself.