-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Allow idle start for Browser Mode #9901
Description
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
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.