-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
55 lines (50 loc) · 1.34 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
/* eslint-env node */
var makeWebpackConfig = require('./webpack/makeConfig');
var getBrowserPath = function(browser) {
return browser.toLowerCase().split(/[ /-]/)[0];
};
var coverageReporter = {
dir: 'coverage/',
reporters: [
{
type: 'html',
subdir: getBrowserPath
},
{
type: 'lcov',
subdir: getBrowserPath
}
]
};
module.exports = function(config) {
config.set({
// autoWatch, it works enabled or not. Probably defined by singleRun.
basePath: '',
browsers: ['PhantomJS'],
coverageReporter: coverageReporter,
exclude: ['./node_modules'],
files: [
'src/test/index.js'
],
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['phantomjs-shim', 'mocha', 'chai'],
logLevel: process.env.CONTINUOUS_INTEGRATION
? config.LOG_WARN
: config.LOG_INFO,
port: 9876,
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'src/test/index.js': ['webpack', 'sourcemap'],
},
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: process.env.CONTINUOUS_INTEGRATION ? [
'coverage', 'mocha'
] : [
'progress', 'coverage', 'beep'
],
webpack: makeWebpackConfig(true),
webpackServer: {
noInfo: true
}
});
};