-
Notifications
You must be signed in to change notification settings - Fork 851
/
karma.conf.js
54 lines (50 loc) · 1.6 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
// Karma configuration file
// See http://karma-runner.github.io/0.10/config/configuration-file.html
const testGlob = 'test/index.js';
var debug = process.env.npm_lifecycle_event === 'test:debug'
const webpackConfig = require('./webpack.config')({ test: true, noCoverage: debug });
module.exports = function (config) {
let reporters = ['jasmine-diff', 'dots', 'spec'];
if (!debug) {
reporters.push('coverage');
}
config.set({
basePath: '',
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
// libraries
'node_modules/lodash/lodash.js',
'node_modules/angular/angular.js',
'node_modules/angular-mocks/angular-mocks.js',
testGlob
],
// generate js files from html templates
preprocessors: {
[testGlob]: ['webpack']
},
webpack: webpackConfig,
webpackMiddleware: {
stats: {
chunks: false,
chunkModules: false,
colors: true,
hash: false
}
},
reporters: reporters,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
singleRun: true,
browsers: [debug ? 'Chrome' : 'PhantomJS'],
coverageReporter: {
reporters: [
{ type: 'lcov', dir: 'out/coverage' },
{ type: 'cobertura', dir: 'out/coverage' },
{ type: 'json', dir: 'out/coverage' },
{ type: 'text-summary' }
]
}
});
};