// Karma configuration
// Generated on Wed Dec 30 2015 15:40:11 GMT-0800 (PST)

module.exports = function(config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['mocha', 'chai-jquery', 'chai-as-promised', 'jquery-1.8.3', 'chai'],

    // list of files / patterns to load in the browser
    files: [
      'spec/javascripts/**/*.spec.js',
      { pattern: '_site/health-care/form.html', watched: true, included: false, served: true, nocache: true },
      { pattern: '_site/**/*', watched: false, included: false, served: true, nocache: true },
      { pattern: 'spec/fixtures/javascripts/**/*', watched: true, included: false, served: true, nocache: true }
    ],


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


    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
    },

    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress'],


    // web server port
    port: 9876,


    // enable / disable colors in the output (reporters and logs)
    colors: true,

    // Make Karma insert a Content-Security-Policy that disables all resource
    // loads that don't original from the same origin. This enforces
    // hermeticity in the test by terminating network loads if the page
    // happens to have a reference to something like Google analytics.
    // In PhantomJS, this is particularly critical because there will be no
    // resource cache. Test times dropped from ~4s to ~1s with this.
    customHeaders: [
      {
        match: '.*\.html',
        name: 'Content-Security-Policy',
        value: "default-src 'self' about:blank; script-src 'self' 'unsafe-inline'"
      },
      {
        // Phantom-JS 1.8.x still uses the vendor prefix. Note this is a hack
        // as the vendor-prefixed behavior diverges from spec and is buggy.
        // However, for our current usage of best-effort reducing of external
        // dependencies in a test, this is good enough.
        match: '.*\.html',
        name: 'X-WebKit-CSP',
        value: "default-src 'self' about:blank; script-src 'self' 'unsafe-inline'"
      }
    ],

    // 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
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['PhantomJS', 'PhantomJS_custom'],

    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: false,

    // to avoid DISCONNECTED messages when connecting
    // TODO(awong): look into why browser was timing out
    browserNoActivityTimeout: 60000, //default 10000

    proxies: {
      '/assets/': '/base/_site/assets'
    },

    // Concurrency level
    // how many browser should be started simultaneous
    concurrency: Infinity
  });
};

@@ -2912,16 +2912,128 @@
 mJS_
-custom'%5D
+debug'%5D,%0A%0A    customLaunchers: %7B%0A      'PhantomJS_debug': %7B%0A        base: 'PhantomJS',%0A        debug: true%0A      %7D%0A    %7D
 ,%0A%0A 

Add PhantomJS_debug target for better debugging.