Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function runServer(config = {}, index) {
if (!config.command) {
throw new JestDevServerError(
'You must define a `command`',
ERROR_NO_COMMAND,
)
}
servers[index] = spawnd(config.command, {
shell: true,
env: process.env,
cwd: cwd(),
...config.options,
})
if (config.debug) {
// eslint-disable-next-line no-console
console.log(chalk.magentaBright('\nJest dev-server output:'))
servers[index].stdout.pipe(serverLogPrefixer).pipe(process.stdout)
}
}