// Karma configuration for webstorm unit tests
'use strict';

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: [
            'client/assets/bower_components/angular/angular.js',
            'client/assets/bower_components/angular-mocks/angular-mocks.js',
            'client/assets/bower_components/angular-resource/angular-resource.js',
            'client/assets/bower_components/angular-cookies/angular-cookies.js',
            'client/assets/bower_components/angular-sanitize/angular-sanitize.js',
            'client/assets/bower_components/angular-route/angular-route.js',
            'client/app/**/*.js',
            'client/common/**/*.js'
        ],

        // list of files / patterns to exclude
        exclude: [],

        // use dots reporter, as travis terminal does not support escaping sequences
        // possible values: 'dots', 'progress'
        // CLI --reporters progress
        reporters: ['dots', 'coverage'],

        preprocessors: {
            'client/app/**/*.js': 'coverage',
            'client/common/**/*.js': 'coverage'
        },

        coverageReporter: {
            type: 'html',
            dir: '.reports/coverage/client'
        },

        // web server port
        port: 8080,

        // enable / disable colors in the output (reporters and logs)
        // CLI --colors --no-colors
        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: false,

        // Start these browsers, currently available:
        // - Chrome
        // - ChromeCanary
        // - Firefox
        // - Opera
        // - Safari (only Mac)
        // - PhantomJS
        // - IE (only Windows)
        browsers: ['Chrome'],

        // If browser does not capture in given timeout [ms], kill it
        // CLI --capture-timeout 5000
        captureTimeout: 20000,

        // Continuous Integration mode
        // if true, it capture browsers, run tests and exit
        singleRun: true,

        // report which specs are slower than 500ms
        // CLI --report-slower-than 500
        reportSlowerThan: 500,

        plugins: [
            'karma-jasmine',
            'karma-chrome-launcher',
            'karma-coverage',
            'karma-junit-reporter'
        ]
    });
};

@@ -19,32 +19,77 @@
 tion
- for webstorm unit tests
+%0A// http://karma-runner.github.io/0.10/config/configuration-file.html
 %0A'us
@@ -1053,622 +1053,42 @@
  // 
-use dots reporter, as travis terminal does not support escaping sequences%0A        // possible values: 'dots', 'progress'%0A        // CLI --reporters progress%0A        reporters: %5B'dots', 'coverage'%5D,%0A%0A        preprocessors: %7B%0A            'client/app/**/*.js': 'coverage',%0A            'client/common/**/*.js': 'coverage'%0A        %7D,%0A%0A        coverageReporter: %7B%0A            type: 'html',%0A            dir: '.reports/coverage/client'%0A        %7D,%0A%0A        // web server port%0A        port: 8080,%0A%0A        // enable / disable colors in the output (reporters and logs)%0A        // CLI --colors --no-colors%0A        colors: true
+web server port%0A        port: 8080
 ,%0A%0A 
@@ -1240,16 +1240,17 @@
 _INFO,%0A%0A
+%0A
         
@@ -1352,24 +1352,25 @@
 ch: false,%0A%0A
+%0A
         // S
@@ -1617,556 +1617,132 @@
 %5D,%0A%0A
-        // If browser does not capture in given timeout %5Bms%5D, kill it%0A        // CLI --capture-timeout 5000%0A        captureTimeout: 20000,%0A%0A        // Continuous Integration mode%0A        // if true, it capture browsers, run tests and exit%0A        singleRun: true,%0A%0A        // report which specs are slower than 500ms%0A        // CLI --report-slower-than 500%0A        reportSlowerThan: 500,%0A%0A        plugins: %5B%0A            'karma-jasmine',%0A            'karma-chrome-launcher',%0A            'karma-coverage',%0A            'karma-junit-reporter'%0A        %5D
+%0A        // Continuous Integration mode%0A        // if true, it capture browsers, run tests and exit%0A        singleRun: false
 %0A   

fix karma debug in webstorm