const{spawn}=require('child_process');const{kill}=require('cross-port-killer');constenv=Object.create(process.env);env.BROWSER='none';conststartServer=spawn('npm',['start'],{env,});startServer.stderr.on('data',(data)=>{// eslint-disable-next-lineconsole.log(data);});startServer.on('exit',()=>{kill(process.env.PORT||8000);});// eslint-disable-next-lineconsole.log('Starting development server for e2e tests...');startServer.stdout.on('data',(data)=>{if(data.toString().indexOf('The app is running at')>=0){// eslint-disable-next-lineconsole.log('Development server is started, ready to run tests.');consttestCmd=spawn('npm',['run','jest'],{stdio:'inherit',});testCmd.on('exit',()=>{startServer.kill();});}});