forked from serratus/quaggaJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
68 lines (67 loc) · 1.93 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
var path = require('path');
var webpack = require('webpack');
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['source-map-support', 'mocha', 'chai', 'sinon', 'sinon-chai'],
files: [
'test/test-main.js',
{pattern: 'test/spec/**/*.js', included: false}
],
preprocessors: {
'test/test-main.js': ['webpack']
},
webpack: {
entry: [
'./src/quagga.js'
],
module: {
loaders: [{
test: /\.jsx?$/,
exclude: [
path.resolve('node_modules/')
],
loader: 'babel-loader'
}, {
test: /\.js$/,
include: path.resolve('src'),
loader: 'babel-istanbul-loader'
}]
},
resolve: {
modules: [
path.resolve('./src/input/'),
path.resolve('./test/mocks/'),
'node_modules'
]
},
plugins: [
new webpack.DefinePlugin({
ENV: require(path.join(__dirname, './env/production'))
})
]
},
plugins: [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-coverage',
'karma-mocha',
'karma-chai',
'karma-sinon',
'karma-sinon-chai',
'karma-source-map-support',
require('karma-webpack')
],
reporters: ['progress', 'coverage'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
coverageReporter: {
type: 'html',
dir: 'coverage/'
}
});
};