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/**/*.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');
}
}
});
};
➜ html-client git:(KARMA_12) ✗ karma start
INFO [karma]: Karma v0.12.1 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 33.0.1750 (Mac OS X 10.9.2)]: Connected on socket tDYS--OFq3zSnpPt2yHV with id 77422872
Chrome 33.0.1750 (Mac OS X 10.9.2): Executed 0 of 0 ERROR (0.017 secs / 0 secs)
^C%
➜ html-client git:(KARMA_12) ✗
➜ html-client git:(KARMA_12) ✗ karma start
INFO [karma]: Karma v0.12.1 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 33.0.1750 (Mac OS X 10.9.2)]: Connected on socket qYzvKdM3NPCJLD3C5ZV2 with id 29499664
Chrome 33.0.1750 (Mac OS X 10.9.2) LOG: {VERSION: '0.12.1', config: Object{args: [], useIframe: true, captureConsole: true}, setupContext: function (contextWindow) { ... }, log: function (type, args) { ... }, stringify: function stringify(obj, depth) { ... }, error: function (msg, url, line) { ... }, result: function (result) { ... }, complete: function (result) { ... }, info: function (info) { ... }, loaded: function () { ... }, store: function (key, value) { ... }, start: function (config) { ... }, files: Object{/base/node_modules/karma-jasmine/lib/jasmine.js: '437512c57124d57f5ec77e2e82bfb4e3cdd15cce', /base/node_modules/karma-jasmine/lib/adapter.js: '8758b57ed804b1772f97ced0c9165fbc2ae4b92f', /base/http-pub/bower/jquery/jquery.js: '1d85f0f3464e5e49b0522744bf7314e176ac76d9', /base/http-pub/bower/knockout/build/output/knockout-latest.debug.js: '52aa3652c3d6116ea7b21afd56e8a1f036603f19', /base/http-pub/bower/lodash/dist/lodash.js: '7e111751ee33d01ff7f3ba5ef3e81eb891083112', /base/http-pub/bower/jasmine-given/dist/jasmine-given.js: '7da0dad75904295fb3c2c7aebc0fc1b65179aa4b', /base/http-pub/bower/angular/angular.js: '7c373a5a6fae112b8d0de3c2bf780ff85b5c4b20', /base/http-pub/bower/angular-ui-router/release/angular-ui-router.js: '3d4aab2bffc95cf758066c6a024bb24aa2601b31', /base/http-pub/bower/angular-mocks/angular-mocks.js: 'de4d415b8593443442815bfe66ae5d7b95189b17', /base/http-pub/angapp/app.js: '713a5293f5c8b3b4c3b1321709532d886dd3dcf3', /base/http-pub/angapp/URLBase.js: '1404d9708f4b2f011e7c5f40a5cb674291197169', /base/http-pub/angapp/components/defaultFilter.js: 'a5c4f8ae02d8363900f6949276e7475c66575dd5', /base/http-pub/angapp/components/kongBindingHandler.js: '056dac5ca21949c1584d0671e6d5293365cb91e6', /base/http-pub/angapp/components/leftMenuDirv.js: 'ac6eb0b4f77e72c8a5046ad49ba34d3ec7395718', /base/http-pub/angapp/components/navHeader/navHeaderDirv.js: '7fd0c4d62f9cb14027b743b30e996a1e0c17fc3a', /base/http-pub/angapp/components/session.js: '4ef76dfae57176f2bb65d56ede2e6bb80f6fe796', /base/http-pub/angapp/components/topBar/topBarDirv.js: '9cfb2668e54680878977247a9be046eec889783e', /base/http-pub/angapp/listening/create/CreateCtrl.js: 'a63693922c385c78d4cee2d09c8f23568b067d14', /base/http-pub/angapp/logFactory.js: '4e94cdef40ccc60e09d07bb5392cb7c9d754a332', /base/http-pub/angapp/modal/modal.js: '7101f9869162495e7199783a75e83d37bf6a5d8d', /base/http-pub/angapp/ng-lodash.js: '512a4ab6d520c3f9ec5fdf03836ad16c98a1ab88', /base/http-pub/angapp/publishing/chooseApprover/main.js: 'e5c61ede1097c444d9af69511e6dedb2f32d2abd', /base/http-pub/angapp/routes.js: 'd070207df681bf5608621b2b0e88bc8375cfbd99', /base/http-pub/angapp/social-login/ProjectController.js: 'a3d2d1a2e63220042629f0529529102b276b2a69', /base/http-pub/angapp/social-login/ProjectListController.js: '52b5628f8ac480d2dc6956f48004832d8745d9ee', /base/http-pub/angapp/social-login/ProjectManager.js: '3a38c89086ab0e4f1f7967a80230168f78e13328', /base/http-pub/angapp/social-login/ProjectService.js: 'ecb48f5815a249c622486a1d5aa13c86568b59cd', /base/specs/_setUp.js: '668d7903ec0f99d65b55076512c42d530c52d3e8', /base/specs/mock-ui-router.js: 'd1ee4fcdfae02997fb3b1c5f4e1f35d50c91e121'}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment