-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
63 lines (62 loc) · 1.71 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
var tcProps = {};
var optionalPlugins = [];
var optionalReporters = [];
// var browsers = ['Chrome'];
var browsers = ['PhantomJS'];
try {
tcProps = require('teamcity-properties');
} catch (err) {
tcProps = false;
}
if (tcProps) {
optionalPlugins.push('karma-teamcity-reporter');
optionalReporters.push('teamcity');
browsers = ['PhantomJS'];
}
module.exports = function(config) {
config.set({
basePath: './src/client',
browsers: browsers,
frameworks: ['jasmine'],
files: [
//3rd party
'vendors.js',
'templates.mdl.js',
'bower_components/angular-mocks/angular-mocks.js',
//app-specific
'app/**/*.html',
'common/**/*.html',
'bundle**.js',
'app/**/*spec.js',
'common/**/*spec.js',
'../server/**/*mock.json'
],
autoWatch: true,
preprocessors: {
'app/**/*.html': ['ng-html2js'],
'common/**/*.html': ['ng-html2js'],
'../server/**/*mock.json': ['json_fixtures']
},
ngHtml2JsPreprocessor: {
moduleName: 'templates'
},
jsonFixturesPreprocessor: {
// strip this from the file path \ fixture name
stripPrefix: '.+mocks/',
// strip this to the file path \ fixture name
// prependPrefix: 'mock/',
// change the global fixtures variable name
variableName: 'mocks'
},
plugins : [
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-jasmine',
'karma-ng-html2js-preprocessor',
'karma-html2js-preprocessor',
'karma-mocha-reporter',
'karma-json-fixtures-preprocessor'
].concat(optionalPlugins),
reporters: ['mocha'].concat(optionalReporters)
});
};