forked from nyarly/NinjaScript
-
Notifications
You must be signed in to change notification settings - Fork 1
/
karma.conf.js
51 lines (42 loc) · 1.38 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
module.exports = function(config){
var coverage = process.env["COVERAGE"]
var conf = {};
conf.files = [
//Library
'node_modules/closure-library/closure/goog/base.js',
'spec_support/jquery-1.6.1.js',
'spec_support/fixtures/*.js',
'spec_support/**/*.html',
{pattern: 'node_modules/closure-library/closure/goog/deps.js', included: false },
'src/deps.js',
//Source code
{pattern: 'src/javascript/**/*.js', included: false},
//Tests
'spec_support/loaded.js',
'spec/**/*.js'
];
conf.autoWatch = true;
conf.browsers = ['Chrome'];
conf.frameworks = ['jasmine', 'sinon', 'closure'];
//conf.plugins = ['karma-closure'];
conf.preprocessors = {
"spec_support/fixtures/**/*.html": ['html2js'],
"spec_support/fixtures/**/*.js": ['html2js'],
'**/src/javascript/**/*.js': ['closure'],
'**/spec/**/*.js': ['closure', 'closure-iit'],
'**/node_modules/closure-library/closure/goog/deps.js': ['closure-deps']
};
if(coverage){
process.stdout.write("COVERAGE is set - instrumenting and only running once\n\n");
conf.singleRun = true;
conf.reporters = ['coverage', 'progress'];
conf.preprocessors['**/src/javascript/**/*.js'] = ['coverage'];
} else {
conf.reporters = ['progress'];
}
conf.junitReporter = {
outputFile: 'test_out/unit.xml',
suite: 'unit'
};
config.set(conf);
}