-
Notifications
You must be signed in to change notification settings - Fork 9
/
karma.conf.js
80 lines (69 loc) · 2.39 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
var path = require('path');
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'chai', 'sinon'],
singleRun: true, //just run once by default
client: {
//mocha configuration
mocha: {
timeout: 10000 // make it 10s
}
},
files: [
'tests.webpack.js', //just load this file
{pattern: 'test/index.html', watched: false, served:true} // load html file
],
preprocessors: {
'test/index.html': ['html2js'], // helps load html file for dom testing
'tests.webpack.js': [ 'webpack', 'sourcemap'] //preprocess with webpack and our sourcemap loader
},
webpack: { //kind of a copy of your webpack config
debug:true,
devtool: 'inline-source-map', //just do inline source maps instead of the default
output: {
library: 'gremlinConsole',
libraryTarget: 'umd'
},
module: {
preLoaders: [
// instrument only testing sources with Istanbul
{
test: /\.js$/,
include: path.resolve('src/'),
loader: 'isparta'
}
],
loaders: [
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel' }
]
}
},
reporters: ['mocha', 'coverage', 'coveralls'],
coverageReporter: {
type: 'lcov', // lcov or lcovonly are required for generating lcov.info files
dir: 'coverage/'
},
port: 9876,
colors: true,
autoWatch: false,
singleRun: false,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
browsers: ['Firefox'],
plugins: [
'karma-phantomjs-launcher',
'karma-firefox-launcher',
'karma-mocha',
'karma-chai',
'karma-webpack',
'karma-sourcemap-loader',
'karma-mocha-reporter',
'karma-coverage',
'karma-coveralls',
'karma-html2js-preprocessor',
'karma-sinon'
]
});
};