Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Electron to run browser tests with Travis #605

Merged
merged 6 commits into from Feb 14, 2016

npm test uses Electron if saucelabs cannot be used

  • Loading branch information
josephfrazier committed Feb 9, 2016
commit d5aa948538671cb0c445ed8c5de71469e99c11c7
@@ -5,14 +5,17 @@ var spawn = require('cross-spawn-async')
var runBrowserTests = process.env.TRAVIS && (!process.env.TRAVIS_PULL_REQUEST ||
process.env.TRAVIS_PULL_REQUEST === 'false')

var node = spawn('npm', ['run', 'test-node'], { stdio: 'inherit' })
node.on('close', function (code) {
if (code === 0 && runBrowserTests) {
var browser = spawn('npm', ['run', 'test-browser'], { stdio: 'inherit' })
browser.on('close', function (code) {
npmRun('test-node', function (code) {
if (code === 0) {
var scriptName = runBrowserTests ? 'test-browser' : 'test-browser-headless'
npmRun(scriptName, function (code) {
process.exit(code)
})
} else {
process.exit(code)
}
})

function npmRun (scriptName, onClose) {
spawn('npm', ['run', scriptName], { stdio: 'inherit' }).on('close', onClose)
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.