-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathkarma.conf.js
71 lines (61 loc) · 1.54 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
var webpack = require("webpack");
module.exports = function(config) {
config.set({
files: [
// all files ending in "test"
'./node_modules/phantomjs-polyfill/bind-polyfill.js',
'test/test.js'
// each file acts as entry point for the webpack configuration
],
// frameworks to use
frameworks: ['mocha'],
preprocessors: {
// only specify one entry point
// and require all tests in there
'test/test.js': ['webpack']
},
reporters: ['spec', 'coverage'],
coverageReporter: {
dir: 'build/coverage/',
reporters: [
{ type: 'html' },
{ type: 'text' },
{ type: 'text-summary' }
]
},
webpack: {
// webpack configuration
module: {
loaders: [
{test: /\.css$/, loader: "style!css"},
{test: /\.less$/, loader: "style!css!less"}
],
postLoaders: [{
test: /\.js/,
exclude: /(test|node_modules|bower_components)/,
loader: 'istanbul-instrumenter'
}]
},
resolve: {
modulesDirectories: [
"",
"src",
"node_modules"
]
}
},
webpackMiddleware: {
// webpack-dev-middleware configuration
noInfo: true
},
plugins: [
require("karma-webpack"),
require("istanbul-instrumenter-loader"),
require("karma-mocha"),
require("karma-coverage"),
require("karma-phantomjs-launcher"),
require("karma-spec-reporter")
],
browsers: ['PhantomJS']
});
};