import { Config , ConfigOptions } from 'karma' ; import webpackConfig from './webpack.test.config' ; export default ( config ) : void => { config . set ( { frameworks : [ 'mocha' , 'chai' , 'sinon' ] , files : [ { pattern : 'src/**/*.ts' , watched : false , included : true , served : true , } , ] , preprocessors : { 'src/**/*.ts?(x)' : [ 'webpack' , 'sourcemap' ] , } , exclude : [ 'src/index.ts' ] , mime : { 'text/x-typescript' : [ 'ts' ] , } , webpack : webpackConfig , webpackMiddleware : { stats : 'errors-only' , bail : true , } , browsers : [ 'Chrome' , 'Firefox' ] , customLaunchers : { ChromeHeadlessNoSandbox : { base : 'ChromeHeadless' , flags : [ '--no-sandbox' , '--disable-setuid-sandbox' ] , } , } , reporters : [ 'mocha' , 'coverage-istanbul' ] , mochaReporter : { showDiff : true , } , client : { mocha : { timeout : 6000 , } , } , coverageIstanbulReporter : { reports : [ 'json' ] , fixWebpackSourcePaths : true , } , } as ConfigOptions ) ; } ;