-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkarma.conf.js
More file actions
107 lines (86 loc) · 2.35 KB
/
karma.conf.js
File metadata and controls
107 lines (86 loc) · 2.35 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
'use strict';
module.exports = function(config) {
var configuration = {
autoWatch : false,
logLevel: config.LOG_ERROR,
frameworks: ['jasmine'],
// files : [
// "builds/dev/serve/app/**/*.js"
// ],
// reporter options
nyanReporter: {
// suppress the error report at the end of the test run
suppressErrorReport: false,
// increase the number of rainbow lines displayed
// enforced min = 4, enforced max = terminal height - 1
numberOfRainbowLines : 4 // default is 4
},
dhtmlReporter: {
'outputFile' : '/tests/dhtmlReport.html',
'exclusiveSections': true,
'openReportInBrowser': false
},
ngHtml2JsPreprocessor: {
stripPrefix: 'src/',
moduleName: 'karma.templates'
// moduleName: function (htmlPath, originalPath) {
// console.log('Karma: ', htmlPath);
// return 'karma.templates';
// }
},
browsers : [
// 'PhantomJS'
// 'Chrome'
],
plugins : [
'karma-phantomjs-launcher',
'karma-jasmine',
'karma-ng-html2js-preprocessor',
'karma-coverage',
"karma-chrome-launcher",
// 'karma-mocha-reporter',
'karma-nyan-reporter'
],
preprocessors: {
'src/**/*.html': ['ng-html2js']
},
// generates the coverage
reporters: [
// 'dots',
'nyan',
'coverage'
// 'html',
// 'mocha',
],
// Output coverage file
coverageReporter: {
type : 'lcov',
subdir : 'report-lcov',
// output path
dir : 'coverage/',
instrumenterOptions: {
istanbul: { noCompact: true }
}
},
mochaReporter: {
output: 'minimal'
}
};
if(!config.suppressCoverage){
configuration.preprocessors['builds/dev/serve/{app,components}/**/!(*spec|*mock).js'] = ['coverage'];
}
// This block is needed to execute Chrome on Travis
// If you ever plan to use Chrome and Travis, you can keep it
// If not, you can safely remove it
// https://github.com/karma-runner/karma/issues/1144#issuecomment-53633076
if(configuration.browsers[0] === 'Chrome' && process.env.TRAVIS) {
configuration.customLaunchers = {
'chrome-travis-ci': {
base: 'Chrome',
flags: ['--no-sandbox']
}
};
configuration.browsers = ['chrome-travis-ci'];
}
config.set(configuration);
};