-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
67 lines (55 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
// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html
var fs = require('fs');
var _ = require('underscore');
module.exports = function( config ) {
// build list of bower components from index.html
// so we can inject them into the files loaded for testing
var bowerScripts = [];
var indexFile = fs.readFileSync( './app/index.html' );
var finder = /<script.+src=['"]bower_components\/([^"']+)["']/gm;
var match = null;
while( (match = finder.exec(indexFile)) != null ) {
var script = "app/bower_components/" + match[1];
bowerScripts.push( script );
}
console.log("Injecting bower_components...\n", bowerScripts, "\n");
config.set( {
basePath: '',
frameworks: ['mocha'],
port: 8080,
autoWatch: true,
singleRun: false,
files: _.flatten( [
// assertion library
'node_modules/expect.js/index.js',
// injected bower components
bowerScripts,
// stubs out dropbox api
'test/mock/**/*.coffee',
'app/scripts/configure.coffee',
'app/scripts/helpers.coffee',
'app/scripts/framework/**/*.coffee',
// karma doesn't know how to recompile templates
'.tmp/scripts/templates.js',
'app/scripts/services/**/*.coffee',
'app/scripts/models/**/*.coffee',
'app/scripts/views/**/*.coffee',
'app/scripts/boot.coffee',
// tests
'test/spec/**/*.coffee'
] ),
exclude: [],
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_INFO,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['PhantomJS']
} );
};