vue/build/karma.sauce.config.js

117 lines
2.5 KiB
JavaScript
Raw Normal View History

2017-03-17 12:09:12 +08:00
var webpack = require('webpack')
2016-04-24 08:00:38 +08:00
var base = require('./karma.base.config.js')
2017-03-17 12:09:12 +08:00
base.webpack.plugins = [
new webpack.DefinePlugin({
__WEEX__: false,
'process.env': {
NODE_ENV: '"development"',
// sauce lab vms are slow!
TRANSITION_DURATION: 500,
TRANSITION_BUFFER: 50
}
})
]
2016-04-24 08:00:38 +08:00
/**
* Having too many tests running concurrently on saucelabs
* causes timeouts and errors, so we have to run them in
* smaller batches.
*/
var batches = [
// the cool kids
{
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 7'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox'
},
sl_mac_safari: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'OS X 10.10'
}
},
// ie family
{
sl_ie_9: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '9'
},
sl_ie_10: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8',
version: '10'
},
sl_ie_11: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11'
},
sl_edge: {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10'
2016-04-24 08:00:38 +08:00
}
},
// mobile
{
sl_ios_safari_8: {
2016-04-24 08:00:38 +08:00
base: 'SauceLabs',
browserName: 'iphone',
version: '8.4'
2016-04-24 08:00:38 +08:00
},
2016-06-28 10:18:13 +08:00
sl_ios_safari_9: {
base: 'SauceLabs',
browserName: 'iphone',
2016-08-06 06:04:51 +08:00
version: '9.3'
2016-06-28 10:18:13 +08:00
},
sl_android_4_4: {
2016-04-24 08:00:38 +08:00
base: 'SauceLabs',
browserName: 'android',
version: '4.4'
2016-06-28 10:18:13 +08:00
},
sl_android_5_1: {
base: 'SauceLabs',
browserName: 'android',
version: '5.1'
2016-04-24 08:00:38 +08:00
}
}
]
module.exports = function (config) {
var batch = batches[process.argv[4] || 0]
config.set(Object.assign(base, {
singleRun: true,
2016-04-24 08:00:38 +08:00
browsers: Object.keys(batch),
customLaunchers: batch,
2016-06-14 06:56:36 +08:00
reporters: process.env.CI
? ['dots', 'saucelabs'] // avoid spamming CI output
: ['progress', 'saucelabs'],
2016-04-24 08:00:38 +08:00
sauceLabs: {
testName: 'Vue.js unit tests',
recordScreenshots: false,
connectOptions: {
'no-ssl-bump-domains': 'all' // Ignore SSL error on Android emulator
},
2016-04-24 08:00:38 +08:00
build: process.env.CIRCLE_BUILD_NUM || process.env.SAUCE_BUILD_ID || Date.now()
},
// mobile emulators are really slow
captureTimeout: 300000,
browserNoActivityTimeout: 300000,
plugins: base.plugins.concat([
'karma-sauce-launcher'
])
2016-04-24 08:00:38 +08:00
}))
}