// Configuration used for local testing and Travis CI

const reporters = process.env.TRAVIS ? ['dots'] : ['progress'];
const browsers = process.env.TRAVIS ? ['ChromeHeadlessNoSandbox'] : ['Chrome'];

module.exports = function (config) {
  config.set({
    basePath: '',
    frameworks: ['jasmine', '@angular-devkit/build-angular'],
    plugins: [
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-firefox-launcher'),
      require('karma-coverage-istanbul-reporter'),
      require('@angular-devkit/build-angular/plugins/karma')
    ],
    coverageIstanbulReporter: {
      dir: require('path').join(__dirname, '..', 'coverage'),
      reports: ['html', 'json', 'lcovonly'],
      fixWebpackSourcePaths: true
    },
    customLaunchers: {
      ChromeHeadlessNoSandbox: {
        base: 'ChromeHeadless',
        flags: ['--no-sandbox']
      }
    },
    reporters,
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers,
    singleRun: false,
    browserNoActivityTimeout: 20000
  });
};

@@ -188,16 +188,28 @@
 %5B'Chrome
+NoExtensions
 '%5D;%0A%0Amod
@@ -884,16 +884,117 @@
 ndbox'%5D%0A
+      %7D,%0A      ChromeNoExtensions: %7B%0A        base: 'Chrome',%0A        flags: %5B'--disable-extensions'%5D%0A
       %7D%0A

disable Chrome extensions for unit tests