This repository has been archived by the owner on Mar 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathkarma.conf.js
72 lines (56 loc) · 2.21 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
'use strict';
module.exports = function(karma) {
var src_path = './js',
preprocessors = {};
preprocessors[src_path+'/components/*.js'] = ['browserify'];
preprocessors[src_path+'/tests/*.js'] = ['browserify'];
var babelIstanbul = require('browserify-babel-istanbul'),
isparta = require('isparta');
karma.set({
frameworks: [ 'jasmine', 'browserify' ],
files: [
{pattern: src_path+'/test_libs/*.js', watched: false, served: true, included: true},
{pattern: src_path+'/components/**/*.js', watched: false, served: true, included: false},
src_path+'/tests/**/*.js'
//'test_libs/**/*.js'
],
reporters: [ 'dots', 'coverage' ],
preprocessors: preprocessors,
browsers: [ 'Chrome' ],
logLevel: 'LOG_DEBUG',
// to avoid DISCONNECTED messages
browserDisconnectTimeout : 10000, // default 2000
browserDisconnectTolerance : 1, // default 0
browserNoActivityTimeout : 60000, //default 10000
// browserify configuration
browserify: {
debug: true,
transform: [
babelIstanbul({
defaultIgnore: false,
instrumenter: isparta,
instrumenterConfig: { babel: { presets: ["es2015"] } },
ignore: ['**/test_libs/**', '**/node_modules/**', '**/bower_components/**', '**/test/**', '**/tests/**', '**/*.json']
}),
['babelify', {presets: ['babel-preset-es2015']}]
]
},
coverageReporter: {
reporters: [
{type: 'html', dir:'./coverage/'},
{type: 'text-summary'}
]
}
//coverageReporter: {
// // configure the reporter to use isparta for JavaScript coverage
// // Only on { "karma-coverage": "douglasduteil/karma-coverage#next" }
// instrumenters: { isparta : require('isparta') },
// instrumenter: {
// '**/*.js': 'isparta'
// },
// instrumenterOptions: {
// isparta: { babel : { presets: 'es2015' } }
// }
//}
});
};