-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.config.js
33 lines (29 loc) · 909 Bytes
/
karma.config.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
'use strict';
var buildConfig = require('./gulp.build.config.js')
, preprocessors = {}
, buildTestDir
, templateDir
, jsDir;
buildTestDir = buildConfig.buildTestDir;
// add slash if missing to properly strip prefix from directive templates
if (buildTestDir[buildTestDir.length - 1] !== '/') {
buildTestDir = buildTestDir + '/';
}
templateDir = buildTestDir + 'templates/';
jsDir = buildConfig.buildJs;
// add slash if missing to properly strip prefix from directive templates
if (jsDir[jsDir.length - 1] !== '/') {
jsDir = jsDir + '/';
}
preprocessors[jsDir + '**/*.js'] = ['coverage'];
preprocessors[templateDir + '**/*-directive.tpl.html'] = ['ng-html2js'];
module.exports = {
browsers: ['PhantomJS'],
frameworks: ['jasmine', 'sinon'],
reporters: ['failed', 'coverage'],
preprocessors: preprocessors,
ngHtml2JsPreprocessor: {
stripPrefix: templateDir
},
singleRun: true
};