-
Notifications
You must be signed in to change notification settings - Fork 56
/
karma.conf.js
52 lines (49 loc) · 1.46 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
/* eslint no-var: 0, no-unused-vars: 0 */
var path = require('path');
var webpack = require('webpack');
var runCoverage = process.env.COVERAGE === 'true';
var coverageLoaders = [];
var coverageReporters = [];
if (runCoverage) {
coverageLoaders.push({
test: /\.js$/,
include: path.resolve('src/'),
loader: 'isparta'
});
coverageReporters.push('coverage');
}
module.exports = function karmaConfig(config) {
config.set({
browsers: ['Chrome'],
singleRun: true,
frameworks: ['mocha'],
files: ['./test.js'],
preprocessors: {
'./test.js': ['webpack', 'sourcemap']
},
reporters: ['mocha'].concat(coverageReporters),
webpack: {
devtool: 'inline-source-map',
resolve: {
alias: {
'react-custom-scrollbars-2': path.resolve(__dirname, './src')
}
},
module: {
loaders: [{
test: /\.js$/,
loader: 'babel',
exclude: /(node_modules)/
}].concat(coverageLoaders)
}
},
coverageReporter: {
dir: 'coverage/',
reporters: [
{ type: 'html', subdir: 'report-html' },
{ type: 'text', subdir: '.', file: 'text.txt' },
{ type: 'text-summary', subdir: '.', file: 'text-summary.txt' },
]
}
});
};