forked from PedroGutierrezStratio/Project-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
48 lines (43 loc) · 1.36 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
module.exports = function(config) {
const settings = require('./gulp.config');
const path = settings.path;
const patterns = settings.patterns;
const assets = settings.assets;
const karmaConf = {
browsers: ['PhantomJS'],
frameworks: ['jasmine'],
files: [
...assets.js,
...assets.jsTest,
path.origin.folder + patterns.allModuleJS,
path.origin.folder + patterns.allJS,
path.origin.folder + patterns.allHTML
],
preprocessors: {},
babelPreprocessor: {
options: {
presets: ['es2015'],
sourceMap: 'inline'
}
},
reporters: ['progress', 'coverage', 'coveralls'],
coverageReporter: {
dir: path.coverage.folder,
reporters: [
{type: 'html', subdir: 'html'},
{type: 'lcovonly', subdir: '.', file: 'lcov.info'},
{type: 'json', subdir: '.'},
]
},
colors: true,
ngHtml2JsPreprocessor: {
stripPrefix: path.origin.folder,
moduleName: path.moduleCoreName
}
};
karmaConf.preprocessors[path.origin.folder + patterns.allModuleJS] = ['babel'];
karmaConf.preprocessors[path.origin.folder + patterns.allJSExcludeTest] = ['coverage','babel'];
karmaConf.preprocessors[path.origin.folder + patterns.allTestJS] = ['babel'];
karmaConf.preprocessors[path.origin.folder + patterns.allHTML] = ['ng-html2js'];
config.set(karmaConf);
};