forked from mixit-craftsmanship/mixit-craftsmanship
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
43 lines (36 loc) · 1.28 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
var globalConfigurationClient = require('./libs/globalConfiguration').client;
var urlPrefix = '/base/public/javascripts/';
var pathPrefix = '/base/';
var pushJavascriptLibsInConfig = function(config, lib){
config.proxies[urlPrefix + lib.name + '.js'] = pathPrefix + lib.path;
config.files.push({pattern: lib.path, included: false});
}
var includeExternalLibs = function(config){
config.proxies = {};
var externalJavascripts = globalConfigurationClient.getExternalJavascriptsWithLocalPath();
for(var key in externalJavascripts){
pushJavascriptLibsInConfig(config, externalJavascripts[key]);
}
pushJavascriptLibsInConfig(config, { name: 'sinon', path: 'bower_components/sinon/lib/sinon.js' });
};
var karmaConfiguration = {
frameworks: ['mocha', 'requirejs', 'chai'],
files: [
'test-main.js',
{pattern: 'public/javascripts/**/*.js', included: false},
{pattern: 'test/public/**/*.js', included: false}
],
exclude: [
'public/javascripts/app.js'
],
autoWatch: true,
browsers: ['PhantomJS'],
reporters: ['progress', 'junit'],
junitReporter: {
outputFile: 'testsKarma-report.xml'
}
};
includeExternalLibs(karmaConfiguration);
module.exports = function(config) {
config.set(karmaConfiguration);
};