forked from chartjs/Chart.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
48 lines (41 loc) · 1.05 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
/* eslint camelcase: 0 */
module.exports = function(karma) {
var args = karma.args || {};
var config = {
browsers: ['Firefox'],
frameworks: ['browserify', 'jasmine'],
reporters: ['progress', 'kjhtml'],
preprocessors: {
'./test/jasmine.index.js': ['browserify'],
'./src/**/*.js': ['browserify']
},
browserify: {
debug: true
}
};
// https://swizec.com/blog/how-to-run-javascript-tests-in-chrome-on-travis/swizec/6647
if (process.env.TRAVIS) {
config.browsers.push('chrome_travis_ci');
config.customLaunchers = {
chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
};
} else {
config.browsers.push('Chrome');
}
if (args.coverage) {
config.reporters.push('coverage');
config.browserify.transform = ['browserify-istanbul'];
// https://github.com/karma-runner/karma-coverage/blob/master/docs/configuration.md
config.coverageReporter = {
dir: 'coverage/',
reporters: [
{type: 'html', subdir: 'report-html'},
{type: 'lcovonly', subdir: '.', file: 'lcov.info'}
]
};
}
karma.set(config);
};