-
Notifications
You must be signed in to change notification settings - Fork 3
/
karma.conf-ci.js
88 lines (82 loc) · 2.15 KB
/
karma.conf-ci.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
var webpack = require('./webpack.config.test')
module.exports = function (config) {
process.env.NODE_ENV = 'test'
// choose from: https://saucelabs.com/platforms/
var customLaunchers = {
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 10'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox'
},
sl_safari: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.11'
},
sl_ie: {
base: 'SauceLabs',
browserName: 'internet explorer'
},
sl_ie_8: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '8'
},
sl_ie_9: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '9'
},
sl_ie_10: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '10'
}
}
// filter browsers for easy cli testing against sauce on particular platforms
if (process.env.BROWSERS) {
var browsers = process.env.BROWSERS.split(',')
customLaunchers = Object.keys(customLaunchers).reduce(function (filteredLaunchers, launcher) {
if (browsers.indexOf(launcher) >= 0) {
filteredLaunchers[launcher] = customLaunchers[launcher]
}
return filteredLaunchers
}, {})
if (Object.keys(customLaunchers).length === 0) {
console.error('You have excluded all launchers with browser filter [%s]', process.env.BROWSERS)
return process.exit(1)
}
}
config.set({
basePath: '',
frameworks: ['mocha'],
files: [
'test/common/**/*.js',
'test/browser/**/*.js'
],
preprocessors: {
'test/common/**/*.js': ['webpack', 'sourcemap'],
'test/browser/**/*.js': ['webpack', 'sourcemap']
},
webpack: webpack,
webpackMiddleware: {
stats: 'errors-only'
},
singleRun: false,
colors: true,
logLevel: config.LOG_INFO,
sauceLabs: {
testName: 'driftwood'
},
customLaunchers: customLaunchers,
browsers: Object.keys(customLaunchers),
reporters: ['spec', 'saucelabs']
})
}