1 |
|
2 |
|
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 |
|
12 | require('karma-jasmine-html-reporter'),
|
13 | require('karma-coverage-istanbul-reporter'),
|
14 | require('@angular/cli/plugins/karma')
|
15 | ],
|
16 | client:{
|
17 | clearContext: false
|
18 | },
|
19 | files: [
|
20 | { pattern: './src/test.ts', watched: false }
|
21 | ],
|
22 | preprocessors: {
|
23 | './src/test.ts': ['@angular/cli']
|
24 | },
|
25 | mime: {
|
26 | 'text/x-typescript': ['ts','tsx']
|
27 | },
|
28 | coverageIstanbulReporter: {
|
29 | reports: [ 'html', 'lcovonly' ],
|
30 | fixWebpackSourcePaths: true
|
31 | },
|
32 | angularCli: {
|
33 | environment: 'dev'
|
34 | },
|
35 | reporters: config.angularCli && config.angularCli.codeCoverage
|
36 | ? ['progress', 'coverage-istanbul']
|
37 | : ['progress', 'kjhtml'],
|
38 | port: 9876,
|
39 | colors: true,
|
40 | logLevel: config.LOG_INFO,
|
41 | autoWatch: true,
|
42 | browsers: ['Chrome'],
|
43 | singleRun: false
|
44 | });
|
45 | };
|