start-server-and-test
start-server-and-test copied to clipboard
Can you kill any running servers with this package (before proceeding with starting new server and test)?
Can I use this library somehow to kill any background running server before I execute "proper" start-server-and-test command?
I have command for cypress like { "test:cypress": "start-server-and-test 'yarn dev' http://localhost:7777 'yarn cy:run'" },
which do the job, but when I forgot to close any other server running on another terminal tab, then tests fail.
What if this command would just kill all the servers running on this port 😄 Or just enforce such behavior by some flag?
Process would go like this:
- Check if port free. No? Kill server running on this port.
- Run the server
- Test
- Close the server