-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to check if server is already running on port #62
Comments
The issue here is that even if That said, there is a solution to this, which was added recently (#52) specifically for this kind of Cypress usage. To handle that case, you should do something like this:
This does a couple of things:
Does that work for you? |
This is perfect, thanks Tim! |
Ok, great! I'll close this for now, but feel free to open a new issue if you run into more problems. |
I'm trying to integrate mockttp with cypress.
From the cypress test I start and stop the server at port 8001 like this.
Now the problem is that whenever a code change is made cypress will restart the test at any moment in time so it's not possible to stop the server. At this moment the test restarts and mockttp throws an error because port 8001 is already in use.
How can I check if a port is already in use and if so restart the server?
I tried this and its not working:
The text was updated successfully, but these errors were encountered: