Skip to content

Instantly share code, notes, and snippets.

@nichoth
Last active February 5, 2019 19:47
Show Gist options
  • Save nichoth/ad9fcbe9c0ca8513d2c8f76a7729de6c to your computer and use it in GitHub Desktop.
Save nichoth/ad9fcbe9c0ca8513d2c8f76a7729de6c to your computer and use it in GitHub Desktop.
cypress + budo (browserify) in a CI server
var cypress = require('cypress')
var Budo = require('budo')
var getPort = require('getport')
getPort(9966, function (err, port) {
if (err) throw err
var budo = Budo.cli(process.argv.slice(2), {
port
}).on('connect', function () {
cypress.run({
config: {
baseUrl: 'http://localhost:' + port
}
}).then(res => {
if (res.totalFailed > 0) process.exit(1)
budo.close()
})
})
})
{
"scripts": {
"cypress-ci": "node ./cypress/scripts/ci.js src/index.js:bundle.js --pushstate --dir=public -- -t babelify -g aliasify -t [ envify --NODE_ENV development ] -dv"
}
}
@nichoth
Copy link
Author

nichoth commented Feb 5, 2019

Note that args for budo/browserify are passed in via cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment