forked from lphilips/formatjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf-ci.js
72 lines (69 loc) · 2.2 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
const {sync: globSync} = require('glob')
module.exports = function (config) {
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.')
process.exit(1)
}
const FILES = globSync('./packages/*/tests/browser.js')
// Browsers to run on Sauce Labs
// Check out https://saucelabs.com/platforms for all browser/OS combos
let customLaunchers
if (process.env.TRAVIS_PULL_REQUEST_SHA) {
customLaunchers = {
sl_chrome: {
base: 'SauceLabs',
browserName: 'internet explorer',
version: '11'
},
}
} else {
customLaunchers = {
// Sauce Labs keeps failing to get a safari instance
// sl_safari: {
// base: 'SauceLabs',
// browserName: 'safari',
// },
sl_edge: {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
},
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
},
sl_ie_11: {
base: 'SauceLabs',
browserName: 'internet explorer',
version: '11'
}
}
}
config.set({
basePath: '',
frameworks: ['mocha', 'chai'],
files: FILES,
reporters: ['progress', 'saucelabs'],
port: 9876,
colors: true,
concurrency: 5,
sauceLabs: {
testName: 'formatjs',
build: process.env.TRAVIS_BUILD_ID,
recordScreenshots: false,
connectOptions: {
port: 5757,
logfile: 'sauce_connect.log'
},
public: 'public'
},
// Increase timeout in case connection in CI is slow
captureTimeout: 120000,
customLaunchers,
browsers: Object.keys(customLaunchers),
singleRun: true
})
};