-
Notifications
You must be signed in to change notification settings - Fork 1
/
karma.config.js
78 lines (63 loc) · 1.99 KB
/
karma.config.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
72
73
74
75
76
77
78
var _ = require("lodash");
var webpack = require('webpack');
var webpackConfig = require("./webpack.config.js");
// prepare webpack config for unit tests
var webpackTestConfig = _.merge({}, webpackConfig, {
devtool: 'inline-source-map',
module: {
postLoaders: [
{
test: /\.ts$/,
loader: 'istanbul-instrumenter'
}
]
}
});
module.exports = function(config) {
config.set({
basePath: '.',
frameworks: ['jasmine', 'jasmine-matchers'],
files: [
'./node_modules/angular/angular.js',
'./node_modules/angular-mocks/angular-mocks.js',
'./node_modules/angular-animate/angular-animate.js',
'./node_modules/angular-aria/angular-aria.js',
'./node_modules/angular-messages/angular-messages.js',
'./node_modules/angular-material/angular-material.js',
'./node_modules/angular-sanitize/angular-sanitize.js',
'./node_modules/rx/dist/rx.js',
'./node_modules/rx-angular/dist/rx.angular.js',
// unit test main entry
'test/unit/test_index.js'
],
preprocessors: {
'test/unit/test_index.js': ['webpack']
},
logLevel: config.LOG_INFO,
webpack: webpackTestConfig,
webpackMiddleware: {
noInfo: true
},
singleRun: true,
browsers: ['PhantomJS'],
reporters: ['progress', 'nested', 'coverage', 'threshold', 'coveralls'],
coverageReporter: {
dir: 'build/reports/coverage',
reporters: [
// reporters not supporting the `file` property
{ type: 'html', subdir: 'report-html' },
{ type: 'lcov', subdir: 'report-lcov' },
{ type: 'cobertura', subdir: '.', file: 'cobertura.txt' },
{ type: 'lcovonly', subdir: '.', file: 'report-lcovonly.txt' },
{ type: 'text', subdir: '.', file: 'text.txt' },
{ type: 'text-summary', subdir: '.', file: 'text-summary.txt' },
]
},
thresholdReporter: {
statements: 48, // 90
branches: 26, // 60
functions: 27, // 85
lines: 47 // 90
}
});
};