You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

31 lines
611 B

var path = require('path')
var httpServer = require('http-server')
var server = httpServer.createServer({
root: path.resolve(__dirname, '../../')
})
server.listen(8080)
var spawn = require('cross-spawn')
var args = [
'--config', 'build/nightwatch.config.js',
'--env', 'chrome,firefox'
]
if (process.argv[2]) {
args.push('--test', 'test/e2e/specs/' + process.argv[2])
}
var runner = spawn('./node_modules/.bin/nightwatch', args, {
stdio: 'inherit'
})
runner.on('exit', function (code) {
server.close()
process.exit(code)
})
runner.on('error', function (err) {
server.close()
throw err
})