Skip to content

Allow idle start for Browser Mode #9901

@donaldpipowitch

Description

@donaldpipowitch

Clear and concise description of the problem

We want to adopt the Vitest Browser Mode, but as far as I can tell it is not possible to start it in some kind of "idle" mode during development. Whenever I start the Browser Mode (not headless; using watch mode) it automatically starts all tests.

Regular Vitest tests seem to have the --standalone option exactly for this use case. (So maybe this can also be considered as a bug, that browser mode doesn't respect the --standalone setting?)

Suggested solution

Allow using --standalone in browser mode. When run non-headless the UI opens, but not test will automatically run - only on manual interaction.

Alternative

Introduce a dedicated flag like --browser.idle, if we don't want to reuse --standalone.

Additional context

Other testing tools that provide a UI (usually E2E testing tools like Cypress and Playwright) have similar behaviour. They open in a view where the developer can choose to run all tests or some tests manually. I'd like to support a similar workflow when I onboard other devs to vitest.

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: browserIssues and PRs related to the browser runnerp3-minor-bugAn edge case that only affects very specific usage (priority)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions