forked from angular/router
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
45 lines (35 loc) · 1.26 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
// This runs the tests for the router in Angular 2.x
var traceurOptions = require('./config').traceur;
var sauceConfig = require('./config/karma.sauce.conf');
var travisConfig = require('./config/karma.travis.conf');
module.exports = function(config) {
var options = {
frameworks: ['jasmine', 'requirejs', 'traceur'],
files: [
// The entry point that dynamically imports all the specs.
{pattern: 'test/main.js', included: true},
// All the specs and sources are included dynamically from `test/main.js`.
{pattern: 'src/**/*.ats', included: false},
{pattern: 'node_modules/route-recognizer/lib/**/*.js', included: false},
{pattern: 'test/**/*.ats', included: false},
// The runtime assertion library.
{pattern: 'node_modules/rtts-assert/dist/amd/assert.js', included: false}
],
preprocessors: {
'**/*.ats': ['traceur'],
'node_modules/route-recognizer/lib/**/*.js': ['traceur']
},
browsers: ['Chrome'],
traceurPreprocessor: {
options: traceurOptions,
transformPath: function(path) {
return path.replace(/\.ats$/, '.js');
}
}
};
if (process.argv.indexOf('--sauce') > -1) {
sauceConfig(options);
travisConfig(options);
}
config.set(options);
};