Last active
March 18, 2019 00:02
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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