-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
54 lines (52 loc) · 1.32 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
var webpackConfig = require('./webpack.config');
var path = require('path');
var onDevMode = process.argv.indexOf('--dev') > -1;
var reporters = onDevMode ? ['spec'] : ['spec', 'coverage'];
webpackConfig.devtool = 'inline-source-map';
if (!onDevMode) {
//@TODO Turn it PRELOADER
webpackConfig.module.postLoaders = [{
test: /\.js$/,
exclude: [/node_modules/, /test/],
loader: 'istanbul-instrumenter'
}]
}
module.exports = function (config) {
config.set({
browsers: [ 'PhantomJS' ],
singleRun: !onDevMode,
frameworks: [ 'mocha', 'chai', 'sinon', 'sinon-chai' ],
files: [
'node_modules/babel-polyfill/dist/polyfill.js',
'test/bundler.js'
],
plugins: [
'karma-phantomjs-launcher',
'karma-chai',
'karma-mocha',
'karma-sourcemap-loader',
'karma-webpack',
'karma-spec-reporter',
'karma-coverage',
'karma-sinon',
'karma-sinon-chai'
],
preprocessors: {
'test/bundler.js': [ 'webpack', 'sourcemap' ]
},
reporters: reporters,
webpack: webpackConfig,
webpackServer: {
noInfo: true
},
coverageReporter: {
dir: 'coverage',
reporters: [
{type: 'text-summary'},
{type: 'html', subdir: 'graph'},
{type: 'lcov', subdir: 'lcov' }
]
},
autoWatch: true
});
};