Jasmine + Require.js + Karma
Rails plugin to integrate Jasmine, Require.js and Karma.
Installation
Add this line to your Rails application's Gemfile:
gem 'jasmine-rjs', group: [:development, :test] # Jasmine testing
gem 'requirejs-rails' # For helper methods and rake tasks
And then execute:
rails g jasmine:install # Install default jasmine configuration
npm install karma karma-cli \
karma-jasmine karma-requirejs \
karma-phantomjs-launcher -g # To test with karma
Usage
To start karma watcher:
rake jasmine:karma
To test from cli:
rake jasmine:ci
Configuration
To override karma configuration, create file karma.conf.js
:
module.exports = function(config) {
config.set({
logLevel: config.LOG_INFO,
browsers: ['Chrome', 'PhantomJS']
});
};
Contributing
- Fork it ( https://github.com/siddick/jasmine-rjs/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request