forked from parallax/jsPDF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.saucelabs.conf.js
57 lines (51 loc) · 1.5 KB
/
karma.saucelabs.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
// Karma configuration
'use strict'
const yaml = require('js-yaml')
const fs = require('fs')
const karmaConfig = require('./karma.common.conf.js')
const browsers = {
sl_ie_11: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 10',
version: '11'
},
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 10',
version: '53'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
version: '49'
}
}
module.exports = (config) => {
// Use ENV vars or .sauce.yml to get credentials
if (!process.env.SAUCE_USERNAME) {
if (!fs.existsSync('.sauce.yml')) {
// eslint-disable-next-line no-console
console.log(
'Create a .sauce.yml with your credentials'
)
process.exit(1)
} else {
let sauceConfig = yaml.safeLoad(fs.readFileSync('.sauce.yml', 'utf8'))
process.env.SAUCE_USERNAME = sauceConfig.addons.sauce_connect.username
process.env.SAUCE_ACCESS_KEY = sauceConfig.addons.sauce_connect.access_key
}
}
config.set({
...karmaConfig,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.DEBUG,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
reporters: ['saucelabs', 'progress', 'coverage', 'mocha', 'verbose'], // 2
browsers: Object.keys(browsers),
customLaunchers: browsers,
})
}