const { spawn } = require('child-process-promise') const waitOn = require('wait-on') let childProcess exports.config = { tests: './test/tests/*_test.js', output: './output', helpers: { Puppeteer: { url: 'http://localhost:8080', show: true } }, include: { I: './test/support/steps_file.js' }, bootstrap: function (done) { let promise = spawn('./node_modules/.bin/vue-cli-service', ['serve']) childProcess = promise.childProcess console.log('[spawn] childProcess.pid: ', childProcess.pid) childProcess.stdout.on('data', function (data) { console.log('[spawn] stdout: ', data.toString()) }); waitOn({resources: ['http://localhost:8080']}) .then(done) .catch(function (err) { handleError(err) done() }); promise.then(function () { console.log('[spawn] done!') }).catch(function (err) { console.error('[spawn] ERROR: ', err) }); }, teardown: function (done) { childProcess.kill('SIGTERM') done() }, mocha: {}, name: 'APP NAME' }