-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkarma.conf.js
64 lines (52 loc) · 1.2 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
var TARGET = process.env.npm_lifecycle_event
var config = {
basePath: '',
frameworks: ['browserify', 'mocha'],
files: [
'node_modules/babel-polyfill/browser.js',
'src/**/*.js',
'test/browser/**/*Spec.js'
],
reporters: ['spec'],
preprocessors: {
'test/browser/**/*.js': ['browserify'],
'src/**/*.js': ['browserify']
},
browsers: ['Chrome'],
// browserify configuration
browserify: {
debug: false,
transform: [
['babelify', {
presets: ['es2015', 'stage-3'],
plugins: [
'transform-runtime',
'transform-decorators-legacy'
]
}],
'envify'
]
},
client: {
mocha: {
reporter: 'html'
}
}
}
if (TARGET === 'coverage') {
config.reporters = ['coverage'].concat(config.reporters)
config.browserify.transform = [require('browserify-babel-istanbul')].concat(config.browserify.transform)
config.coverageReporter = {
dir: 'coverage',
reporters: [
{ type: 'html', subdir: 'report-html' },
{ type: 'text-summary' }
]
}
}
if (TARGET === 'test:watch') {
config.reporters = ['clear-screen'].concat(config.reporters)
}
module.exports = function (karma) {
karma.set(config)
}