'use strict';

module.exports = function(config) {

  config.set({
    frameworks: ['<%= testFramework %>', 'browserify'],
    files: [
      'src/**/*.js',
      'test/**/*.js',
      { pattern: 'src/**/*.ts', included: false, watched: false },
      { pattern: 'test/**/*.ts', included: false, watched: false },
      { pattern: 'src/**/*.js.map', included: false, watched: true },
      { pattern: 'test/**/*.js.map', included: false, watched: true }
    ],
    preprocessors: {
      'src/**/*.js': ['browserify'],
      'test/**/*.js': ['browserify']
    },
    browserify: {
      transform: ['browserify-istanbul']
    },
    browsers: [
      'Chrome'
    ],
    reporters: ['progress', 'coverage'],
      coverageReporter: {
          type: 'json',
          subdir: '.',
          file: 'coverage-final.json'
      },
    singleRun: true

  });
};

@@ -68,59 +68,216 @@
     
-frameworks: %5B'%3C%25= testFramework %25%3E', 'browserify'%5D,
+// frameworks to use%0A    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter%0A    frameworks: %5B'%3C%25= testFramework %25%3E', 'browserify'%5D,%0A%0A    // list of files / patterns to load in the browser
 %0A   
@@ -606,24 +606,177 @@
 rue %7D%0A    %5D,
+%0A%0A    // preprocess matching files before serving them to the browser%0A    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
 %0A    preproc
@@ -858,32 +858,34 @@
 serify'%5D%0A    %7D,%0A
+%0A%0A
     browserify: 
@@ -938,45 +938,314 @@
  %7D,%0A
-    browsers: %5B%0A      'Chrome'%0A    %5D,
+%0A    // start these browsers%0A    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher%0A    browsers: %5B%0A      'Chrome'%0A    %5D,%0A%0A    // test results reporter to use%0A    // possible values: 'dots', 'progress'%0A    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
 %0A   
@@ -1278,26 +1278,25 @@
 coverage'%5D,%0A
-  
+%0A
     coverage
@@ -1315,18 +1315,16 @@
         
-  
 type: 'j
@@ -1337,18 +1337,16 @@
         
- 
- 
 subdir: 
@@ -1350,18 +1350,16 @@
 r: '.',%0A
-  
         
@@ -1390,20 +1390,120 @@
 on'%0A    
-  
 %7D,
+%0A%0A    // Continuous Integration mode%0A    // if true, Karma captures browsers, runs the tests and exits
 %0A    sin
@@ -1515,17 +1515,16 @@
 n: true%0A
-%0A
   %7D);%0A%7D;

Update karma coverage file comments.