start-server-and-test icon indicating copy to clipboard operation
start-server-and-test copied to clipboard

Can you kill any running servers with this package (before proceeding with starting new server and test)?

Open mifrej opened this issue 5 years ago • 0 comments

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:

  1. Check if port free. No? Kill server running on this port.
  2. Run the server
  3. Test
  4. Close the server

mifrej avatar Aug 04 '20 17:08 mifrej