-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Check for listen port collision for browser tests #5725
Comments
Vitest doesn't hardcode port and just calls |
Hello @DenizUgur. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with |
If you have existing browser test can you run the following before running the tests? If that doesn't reproduce, I'll create dedicated example. docker run -it --rm --name nginx -p 5173:80 nginx |
This single command requires a lot of setup to run, hardly a minimal reproduction. |
Actually, I found a line where we set the default port, but it's not
|
I'm sorry, I assumed |
Clear and concise description of the problem
The current behavior of vitest with browser mode is that it will try to use
server.port
(or 5173) regardless if that port is available. If that port is occupied and serves a page (unrelated to the project) the test runner hangs.Suggested solution
If
server.port
or5173
is not available start listening on available port (similar to how vite works)Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: