forked from digideskio/MoonMail-UI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
52 lines (48 loc) · 1 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
import {argv} from 'yargs';
import webpackConfigFactory from './webpack.config';
const webpackConfig = webpackConfigFactory({
test: true,
coverage: !argv.watch
});
const karmaConfig = {
files: [
{
pattern: './tests/testBundler.js',
watched: false,
served: true,
included: true
}
],
singleRun: !argv.watch,
frameworks: ['mocha'],
reporters: ['mocha'],
preprocessors: {
['./tests/testBundler.js']: ['webpack']
},
browsers: ['PhantomJS'],
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true,
stats: 'errors-only'
},
coverageReporter: {
reporters: [
{type: 'text-summary'},
{type: 'lcov', dir: 'coverage'}
],
check: {
global: {
statements: 50,
branches: 50,
functions: 50,
lines: 50,
excludes: []
}
}
}
};
if (!argv.watch) {
karmaConfig.reporters.push('coverage');
}
// cannot use `export default` because of Karma.
module.exports = (cfg) => cfg.set(karmaConfig);