-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
41 lines (39 loc) · 1.05 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
var path = require('path');
var istanbul = require('browserify-istanbul');
var basePath = path.resolve(process.cwd(), './src/lib');
module.exports = function (config) {
config.set({
browsers: ['PhantomJS'],
frameworks: ['mocha', 'chai', 'browserify'],
reporters: ['coverage', 'mocha'],
files: [
'src/**/*.js',
'tests/**/*.js',
],
preprocessors: {
'src/**/*.js': ['browserify', 'env'],
'tests/**/*.js': ['browserify', 'env'],
},
browserify: {
debug: true,
configure: function (bundle) {
bundle.once('prebundle', function () {
bundle.transform('babelify').transform(istanbul)
});
},
paths: [basePath]
},
coverageReporter: {
instrumenters: { isparta: require('isparta') },
instrumenter: {
'src/**/!(*.spec).js': 'isparta'
},
reporters: [
{ type: 'text-summary' },
{ type: 'lcovonly', file: './../lcov.info' },
{ type: 'html', dir: 'coverage/' }
]
},
envPreprocessor: ['NODE_ENV'],
});
};