-
Notifications
You must be signed in to change notification settings - Fork 12
/
karma.conf.js
74 lines (70 loc) · 2.36 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
68
69
70
71
72
73
74
/*jshint browser:false, node:true */
// Karma test runner configuration
// see http://karma-runner.github.io/0.12/config/configuration-file.html
module.exports = function(config) {
'use strict';
console.info('========== ' + (process.env.KARMA_ENV || 'native') + ' ==========\n');
config.set({
frameworks: [ 'qunit', 'sinon' ],
files: [
'tests/config/karma-init.js',
'bower_components/bind-polyfill/index.js'
].concat(
{
jquery: ['bower_components/jquery/dist/jquery.js'],
rsvp: ['bower_components/rsvp/rsvp.js'],
q: ['bower_components/q/q.js'],
native: [
'tests/config/disable-native-promise.js',
'bower_components/promise-polyfill/Promise.js'
],
'native-amd': [
'tests/config/disable-native-promise.js',
'bower_components/promise-polyfill/Promise.js',
'bower_components/requirejs/require.js'
],
'promise-provider-aplus': [
'bower_components/vow/lib/vow.js',
'tests/config/promise-provider-aplus.js'
],
'promise-provider-custom': [
'bower_components/ayepromise/ayepromise.js',
'tests/config/promise-provider-custom.js'
]
}[process.env.KARMA_ENV || 'native']
).concat([
{ pattern: 'tests/stubs/*', watched: true, included: false, served: true },
'src/promise-window.js',
'tests/*.test.js'
]),
browsers: process.env.CI ? [ 'PhantomJS' ] : [ 'Chrome', 'PhantomJS_debug' ],
reporters: process.env.CI ? [ "dots", "coverage" ] : [ "progress" ],
preprocessors: !process.env.CI ? {} : {
"src/**/*.js": [ "coverage" ]
},
coverageReporter: !process.env.CI ? {} : {
dir: "tests/coverage",
reporters: [
{ type: "json", subdir: ".", file: "coverage-" + (process.env.KARMA_ENV) + ".json" }
]
},
customLaunchers: process.env.CI ? {} : {
'PhantomJS_debug': {
base: 'PhantomJS',
options: {
windowName: 'Custom PhantomJS',
settings: {
webSecurityEnabled: false
}
},
flags: [
'--remote-debugger-port=9000',
'--remote-debugger-autorun=yes',
'--debug=true'
]
}
},
singleRun: !!process.env.CI,
autoWatch: !process.env.CI
});
};