-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathkarma.conf.es6
58 lines (54 loc) · 1.21 KB
/
karma.conf.es6
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
// convert args to named args
const namedArgs = process.argv.reduce((o, v) => {
o[v] = true;
return o;
}, {});
const files = [];
const customPath = process.env.npm_config_path;
if (!customPath) {
files.push('src/**/__tests__/**/*.js');
} else {
files.push(customPath);
}
files.push(
{
pattern: 'src/**/__tests__/fixtures/**/*',
watched: true,
included: false,
served: true
}
);
export default (config) => {
config.set({
basePath: '',
browserNoActivityTimeout: 50000,
files,
frameworks: ['jasmine-ajax', 'jasmine'],
browsers: ['Chrome'],
preprocessors: { './src/**/*.js': ['webpack'] },
reporters: '--ci' in namedArgs ? ['spec', 'junit', 'coverage'] : ['spec'],
coverageReporter: {
dir: 'reports',
reporters: [
{ type: 'lcov', subdir: 'report-lcov' }
]
},
webpack: require('./webpack.config'),
plugins: [
'karma-webpack',
'karma-chrome-launcher',
'karma-jasmine',
'karma-jasmine-ajax',
'karma-junit-reporter',
'karma-coverage',
'karma-spec-reporter'
],
webpackMiddleware: {
noInfo: true
},
junitReporter: {
outputDir: 'test_out',
suite: 'unit'
}
});
};