|
| 1 | +// Karma configuration file, see link for more information |
| 2 | +// https://karma-runner.github.io/0.13/config/configuration-file.html |
| 3 | + |
| 4 | +module.exports = function (config) { |
| 5 | + config.set({ |
| 6 | + basePath: '', |
| 7 | + frameworks: ['jasmine', '@angular/cli'], |
| 8 | + plugins: [ |
| 9 | + require('karma-jasmine'), |
| 10 | + require('karma-chrome-launcher'), |
| 11 | + require('karma-jasmine-html-reporter'), |
| 12 | + require('karma-coverage-istanbul-reporter'), |
| 13 | + require('@angular/cli/plugins/karma') |
| 14 | + ], |
| 15 | + client:{ |
| 16 | + clearContext: false // leave Jasmine Spec Runner output visible in browser |
| 17 | + }, |
| 18 | + files: [ |
| 19 | + { pattern: './src/test.ts', watched: false } |
| 20 | + ], |
| 21 | + preprocessors: { |
| 22 | + './src/test.ts': ['@angular/cli'] |
| 23 | + }, |
| 24 | + mime: { |
| 25 | + 'text/x-typescript': ['ts','tsx'] |
| 26 | + }, |
| 27 | + coverageIstanbulReporter: { |
| 28 | + reports: [ 'html', 'lcovonly' ], |
| 29 | + fixWebpackSourcePaths: true |
| 30 | + }, |
| 31 | + angularCli: { |
| 32 | + environment: 'dev' |
| 33 | + }, |
| 34 | + reporters: config.angularCli && config.angularCli.codeCoverage |
| 35 | + ? ['progress', 'coverage-istanbul'] |
| 36 | + : ['progress', 'kjhtml'], |
| 37 | + port: 9876, |
| 38 | + colors: true, |
| 39 | + logLevel: config.LOG_INFO, |
| 40 | + autoWatch: true, |
| 41 | + browsers: ['Chrome'], |
| 42 | + singleRun: false |
| 43 | + }); |
| 44 | +}; |
0 commit comments