forked from zxing-js/library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
107 lines (87 loc) · 2.42 KB
/
karma.conf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/**
* Karma configuration file.
*
* @see https://karma-runner.github.io/0.13/config/configuration-file.html
*/
import * as path from 'path';
const ROOT = path.resolve(__dirname, '.');
function rootPath() {
return path.join.apply(
path, [ROOT].concat(Array.prototype.slice.call(arguments, 0))
);
}
export default function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'karma-typescript', 'chai', 'sinon'],
files: ['src/**/*.ts'],
preprocessors: {
'**/*.ts': ['karma-typescript']
},
plugins: [
require('karma-coverage'),
require('karma-mocha'),
require('karma-chai'),
require('karma-sinon'),
require('karma-remap-coverage'),
require('karma-typescript'),
require('karma-typescript-preprocessor'),
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
/**
* add both "karma-coverage" and "karma-remap-coverage" reporters
*/
reporters: ['progress', 'coverage', 'remap-coverage', 'dots', 'karma-typescript'],
/**
* save interim raw coverage report in memory
*/
coverageReporter: {
type: 'in-memory'
},
/**
* define where to save final remaped coverage reports
*/
remapCoverageReporter: {
'text-summary': null,
html: './coverage/html',
cobertura: './coverage/cobertura.xml'
},
/**
* Port to listen in browser.
*/
port: 9876,
/**
* Cool colors in CLI
*/
colors: true,
/**
* Wath kinda logs should be shown
*/
logLevel: config.LOG_INFO,
/**
* Watch for code modifications
*/
autoWatch: true,
/**
* What browsers should be used
*/
browsers: ['Chrome_headless'],
customLaunchers: {
Chrome_headless: {
base: 'Chrome',
flags: [
' — headless',
' — disable-gpu',
' — remote-debugging-port=9222'
]
}
},
/**
* Keep testing or not.
*/
singleRun: false,
concurrency: Infinity
});
};