Skip to content

Dynamic port #383

Description

@tobiasBora

If I specify:

start-server-and-test start-server http://localhost:8080 test

to start the webserver automatically, I need to know the port it will be using in advance. But by default, vite will pick the first port that is available (which I consider to be a good thing)… hence I cannot know in advance the code to port to use.

I'd love start-server-and-test to automatically detect the URL/port… not sure what is the best solution for this, but maybe using a (configurable) regexp to parse the first occurence of an url like http://localhost:5176/ in stdout would be a good solution. This URL should then automatically be forwarded to the script, I guess the simplest would be using an environment variable.

See also the related microsoft/playwright#31235

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions