-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathkarma.conf.js
71 lines (56 loc) · 1.64 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
'use strict';
var path = require('path');
module.exports = function(config) {
config.set({
basePath: '',
files: [
'node_modules/sinon/pkg/sinon.js', // sinon doesn't work with webpack, so we have to load the browser version
'test/**/*.test.js',
{ pattern: 'public/**', watched: false, included: false, served: true }
],
preprocessors: {
'test/**/*.test.js': ['webpack', 'sourcemap'],
'lib/**/*.js': ['coverage']
},
webpack: {
devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.js$/,
use: { loader: 'istanbul-instrumenter-loader' },
include: path.resolve('lib/'),
exclude: /((test|node_modules)\/)|(lib\/detect\/(browser.js|environment.js))/
}
]
}
},
webpackMiddleware: {
stats: false
},
reporters: ['progress'],
coverageReporter: {
type: 'lcov',
dir: 'coverage',
instrumenterOptions: {
istanbul: { noCompact: true }
}
},
frameworks: ['mocha'],
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
// Number of browsers to run in parallel [set to 1 to avoid timing-based tests from failing]
concurrency: 1,
browsers: ['Firefox', 'Chrome']
});
if (process.env.TRAVIS) {
config.browsers = ['Firefox', 'Chrome_travis_ci'];
}
if (process.argv.indexOf('--with-coverage') > -1) {
config.reporters.push('coverage');
}
};