Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// force shutdown after 15s timeout
setTimeout(() => {
debug(`Could not close server in time, forcefully shutting down`);
process.exit();
}, (15e3));
};
debug(`es-dev-server running at port ${PORT}...`);
[
'SIGTERM', // kill
'SIGINT', // Ctrl or Cmd + C
].forEach(n => process.on(n, gracefulShutdown));
const wdio = new Launcher(readArg('--config-file'));
await wdio.run();
debug(`Completed. Closing server...`);
gracefulShutdown();
}
function runE2eTests(configFilePath, runSelenium) {
const wdio = new Launcher(configFilePath, {})
function runWdio() {
wdio.run().then(
function(code) {
process.stdin.pause()
process.nextTick(() => process.exit(code))
},
function(error) {
console.error('Launcher failed to start the test', error)
process.stdin.pause()
process.nextTick(() => process.exit())
}
)
}
if (runSelenium) {
startSelenium(runWdio)
} else {
exports.run = async function() {
const Launcher = require('@wdio/cli').default;
const wdio = new Launcher(
__dirname + '/../../test/functional/wdio.conf.js', {});
return await wdio.run();
};