Skip to content

Instantly share code, notes, and snippets.

@falsefalse
Created March 21, 2017 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save falsefalse/30a544b312bacd0f13d254bb29a6b624 to your computer and use it in GitHub Desktop.
Save falsefalse/30a544b312bacd0f13d254bb29a6b624 to your computer and use it in GitHub Desktop.
// browserstack (read: IE11) config
const karma = require('./karma.common.js')
const appComponents = require('./app_components.js')
const browserStackLauncher = {
ie11: {
'base': 'BrowserStack',
'browser': 'ie',
'browser_version': '11.0',
'os': 'Windows',
// Pick OS from the env variable or use Windows 7
'os_version': process.env.OS || '7',
'name': appComponents.id
}
}
const options = {
preprocessors: {
[appComponents.all[appComponents.id]]: ['webpack', 'gzip'],
},
// Browsers configuration
browsers: [Object.keys(browserStackLauncher)],
customLaunchers: browserStackLauncher,
browserStack: {
// Increase polling time to avoid hitting BS rate limit, default is 1000
pollingTimeout: 5 * 1000, /* 5 seconds */
// https://github.com/karma-runner/karma-browserstack-launcher/issues/17#issuecomment-181559755
startTunnel: true,
// if tests ain't completed during this timespan IE is stalled
timeout: 4 * 60, /* 4 minutes */
name: process.env.BUILD_TAG || false,
project: 'Platform'
},
// We are limited in the number of parallel VMs in BrowserStack (5)
// and Karma don't know how to limit parallel browser instances
// so waiting time must be insanely high. Default is 10 * 1000
browserNoActivityTimeout: 3 * 60 * 1000, /* 3 minutes */
captureTimeout: 90 * 1000, /* 1.5 minutes */
// Make Karma more tolerant to disconnects. It's required to make
// BrowserStack tests more stable. Default is 2000.
browserDisconnectTimeout: 30 * 1000, /* 30 sec */
browserDisconnectTolerance: 5,
// Reporters configuration
reporters: ['mocha', 'BrowserStack'],
mochaReporter: {
output: 'minimal'
}
}
module.exports = function (config) {
karma(config, options)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment