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: '' }