You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I already have running local server on port 1234
I was sure that start-server-and-test :1234 'cypress open --e2e --browser chrome' first will check if it is not running already before starting the local server.
Why this is not the case?
The text was updated successfully, but these errors were encountered:
How can it know if a server is already running? It could try connecting to the port, but that only confirms that something is listening... it could be a server from a different project!
I like that start-server-and-test will take ownership of the test server and terminates it when the tests are done. If it becomes too clever about using already running servers, it becomes too complex.
If your test server and development server are frequently fighting over the same port, may I suggest using a different port number for testing? You can even use a random port each time with a script like this:
Using curl and grep you can check if the URL, that you expect dev server to be running on, responds with 200 code.
And if not, then you can start dev server.
With npm script it can be something like the following:
If I already have running local server on port
1234
I was sure that
start-server-and-test :1234 'cypress open --e2e --browser chrome'
first will check if it is not running already before starting the local server.Why this is not the case?
The text was updated successfully, but these errors were encountered: