Inspired by http://monterail.com/blog/2014/karma-on-rails/
This basically allows you to reference your application JS files, which are generated by Sprockets, in the Karma config like this:
files: [
'<%= require("application.js") %>',
'<%= require("other.js") %>',
'static/files/**/*.js'
]
Add PhantomJS gem to your Gemfile
:
gem "phantomjs"
Install Karma.js and the PhantomJS runner:
npm install --save-dev karma karma-phantomjs-launcher