Skip to content

Instantly share code, notes, and snippets.

@Wizek
Last active August 29, 2015 13:57
Show Gist options
  • Save Wizek/8e926157f9593ddc6a4a to your computer and use it in GitHub Desktop.
Save Wizek/8e926157f9593ddc6a4a to your computer and use it in GitHub Desktop.
// Karma configuration
// Generated on Mon Jan 13 2014 15:28:06 GMT+0100 (CET)
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// frameworks to use
frameworks: ['jasmine'],
plugins: [
'karma-coffee-preprocessor',
'karma-jasmine',
'karma-chrome-launcher'
],
// list of files / patterns to load in the browser
files: [
'http-pub/bower/jquery/jquery.js',
'http-pub/bower/knockout/build/output/knockout-latest.debug.js',
'http-pub/bower/lodash/dist/lodash.js',
'http-pub/bower/jasmine-given/dist/jasmine-given.js',
'http-pub/bower/angular/angular.js',
'http-pub/bower/angular-ui-router/release/angular-ui-router.js',
'http-pub/bower/angular-mocks/angular-mocks.js',
'http-pub/angapp/app.js',
'http-pub/angapp/**/*.js',
'specs/_setUp.js',
'http-pub/angapp/**/*.html',
'specs/**/*.coffee',
'http-pub/angapp/**/*.coffee'
],
// list of files to exclude
exclude: [
],
preproccessors: {
'**/*.coffee': 'coffee',
'**/*.html': ['ng-html2js']
},
// test results reporter to use
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters: ['progress'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.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 (has to be installed with `npm install karma-opera-launcher`)
// - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
// - PhantomJS
// - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
browsers: ['Chrome'],
// If browser does not capture in given timeout [ms], kill it
captureTimeout: 60000,
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false,
ngHtml2JsPreprocessor: {
// strip this from the file path
stripPrefix: 'http-pub',
// prepend this to the
// prependPrefix: 'served/',
// or define a custom transform function
// cacheIdFromPath: function(filepath) {
// return cacheId;
// },
// setting this option will create only a single module that contains templates
// from all the files, so you can load them all with module('foo')
moduleName: 'App'
},
// coffeePreprocessor: {
// // options passed to the coffee compiler
// options: {
// bare: true,
// sourceMap: false
// },
// // transforming the filenames
// transformPath: function(path) {
// console.log(path)
// return path.replace(/\.coffee$/, '.js');
// }
// }
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment