Skip to content

Instantly share code, notes, and snippets.

@dunckr
Last active December 21, 2015 15:39
Show Gist options
  • Save dunckr/6328600 to your computer and use it in GitHub Desktop.
Save dunckr/6328600 to your computer and use it in GitHub Desktop.
Backbone, CoffeeScript and Karma setup
// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
"app/bower_components/modernizr/modernizr.js",
"app/bower_components/jquery/jquery.js",
"app/bower_components/underscore/underscore.js",
"app/bower_components/backbone/backbone.js",
"app/bower_components/handlebars/handlebars.js",
'.tmp/scripts/**/*.js',
'.tmp/spec/**/*.js'
],
// list of files / patterns to exclude
exclude: [],
// web server port
port: 8081,
// cli runner port
runnerPort: 9100,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['PhantomJS'],
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false
});
};
yo backbone --coffee --test-framework=karma --template-framework=handlebars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment