This repository has been archived by the owner on Mar 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
karma-coverage.conf.js
61 lines (49 loc) · 1.62 KB
/
karma-coverage.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
'use strict';
var isparta = require('isparta');
var merge = require('merge');
var utils = require('./utils');
var babelOptions = {
presets: ['metal-resolve-source', 'es2015'],
sourceMap: 'both'
};
var scssOptions = {
includePaths: ['node_modules'],
sourceMap: true
};
var coveragePreprocessors = {};
utils.getComponentPaths('src', '!(*.soy).js').forEach(function(filepath) {
coveragePreprocessors[filepath] = ['coverage'];
});
module.exports = function (config) {
config.set({
frameworks: ['mocha', 'chai', 'source-map-support', 'commonjs', 'sinon'],
files: [
'node_modules/metal-soy-bundle/build/bundle.js',
'node_modules/html2incdom/src/*.js',
'node_modules/metal*/src/**/*.js',
'node_modules/metal-drag-drop/test/fixtures/DragTestHelper.js',
'node_modules/metal-*/src/**/*.scss'
].concat(utils.getComponentPaths('test')),
preprocessors: merge(coveragePreprocessors, {
'node_modules/html2incdom/src/*.js': ['babel', 'commonjs'],
'node_modules/metal-soy-bundle/build/bundle.js': ['babel', 'commonjs'],
'node_modules/metal*/src/**/*.js': ['babel', 'commonjs'],
'node_modules/metal-*/test/**/*.js': ['babel', 'commonjs'],
'node_modules/metal-*/src/**/*.scss': ['scss']
}),
browsers: ['Chrome'],
reporters: ['coverage', 'progress'],
babelPreprocessor: {options: babelOptions},
scssPreprocessor: {options: scssOptions},
coverageReporter: {
instrumenters: {isparta : isparta},
instrumenter: {'**/*.js': 'isparta'},
instrumenterOptions: {isparta: {babel: babelOptions}},
reporters: [
{type: 'html'},
{type: 'lcov', subdir: 'lcov'},
{type: 'text-summary'}
]
}
});
};