-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkarma.conf.js
85 lines (70 loc) · 1.76 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/* jshint strict: false */
var files = require('./build/files');
var getFilesList = function() {
var scripts = [
'bower_components/jquery/dist/jquery.js',
'bower_components/jasmine-jquery/lib/jasmine-jquery.js',
'bower_components/angular/angular.js',
];
// mocks
scripts.unshift('spec/support/bindMock.js');
// appends appliction files
scripts = scripts.concat(files.scripts);
// appends some more files...
scripts = scripts.concat([
// angular mocks
'bower_components/angular-mocks/angular-mocks.js',
// test files
'spec/**/*.js',
// template files
'src/templates/**/*.html',
]);
return scripts;
};
var getPreprocessors = function() {
var processors = { '**/*.html': 'ng-html2js' };
// adds coverage processor
files.scripts.forEach(function(file) {
processors[file] = 'coverage';
});
return processors;
};
var getReporters = function() {
var reporters = ['progress'];
if (process.env.TRAVIS) {
reporters.push('coverage');
}
return reporters;
};
module.exports = function(config) {
config.set({
basePath : './',
files : getFilesList(),
preprocessors: getPreprocessors(),
reporters: getReporters(),
autoWatch : true,
frameworks: ['jasmine'],
browsers : ['PhantomJS'],
plugins : [
'karma-phantomjs-launcher',
'karma-jasmine',
'karma-ng-html2js-preprocessor',
'karma-coverage',
],
ngHtml2JsPreprocessor: {
stripPrefix: 'src/templates/',
prependPrefix: 'templates/pa-datepicker/',
moduleName: 'pa-datepicker',
},
coverageReporter: {
reporters: [{
type: 'text-summary',
}, {
type: 'lcovonly',
dir: '.',
subdir: '.',
file: 'coverage.info',
}]
},
});
};