Skip to content

Instantly share code, notes, and snippets.

@DrPep
Last active March 18, 2019 00:02
Show Gist options
  • Save DrPep/05955fe8b51735fd0b7ddbf72198b8a4 to your computer and use it in GitHub Desktop.
Save DrPep/05955fe8b51735fd0b7ddbf72198b8a4 to your computer and use it in GitHub Desktop.
End 2 End tests for VueJS using Webpack Dev Server - start server, wait for response, continue
const { spawn } = require('child_process')
const waitOn = require('wait-on')
let subProcess
exports.config = {
tests: './test/tests/*_test.js',
output: './output',
helpers: {
Puppeteer: {
url: 'http://localhost:8080',
show: false,
chrome: {
"args": ["--no-sandbox", "--disable-setuid-sandbox", "--single-process"]
}
}
},
include: {
I: './test/support/steps_file.js'
},
bootstrap: function (done) {
subProcess = spawn('./node_modules/.bin/http-server', ['./dist'], {
detached: true
})
waitOn({resources: ['http://localhost:8080']})
.then(done)
.catch(function (err) {
console.log('[spawn] Error starting server')
done()
});
},
teardown: function (done) {
subProcess.kill()
done()
},
mocha: {},
name: '<APP NAME GOES HERE>'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment