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.
30 lines
527 B
30 lines
527 B
9 years ago
|
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 runner = spawn(
|
||
|
'./node_modules/.bin/nightwatch',
|
||
|
[
|
||
|
'--config', 'build/nightwatch.config.js',
|
||
|
'--env', 'chrome,firefox'
|
||
|
],
|
||
|
{
|
||
|
stdio: 'inherit'
|
||
|
}
|
||
|
)
|
||
|
|
||
|
runner.on('exit', function (code) {
|
||
|
server.close()
|
||
|
process.exit(code)
|
||
|
})
|
||
|
|
||
|
runner.on('error', function (err) {
|
||
|
server.close()
|
||
|
throw err
|
||
|
})
|