Skip to content

Add init command for browser tests #5793

@sheremet-va

Description

@sheremet-va

Clear and concise description of the problem

Currently, enabling browser mode is not a very straightforward process. As a user who just wants to try it, I need to:

  • enable browser in the config
  • run vitest, see @vitest/browser is not installed
  • install @vitest/browser
  • see webdriverio is not installed
  • ask yourself what webdriverio is, install it
  • run vitest, see I forgot the browser name
  • add browser name to the config

Suggested solution

  1. We need to improve documentation on how the browser mode works internally
  2. Add vitest init-browser-mode (name TBD) command that asks what provider should be installed and what browser, then it scaffolds files to enable the browser mode integration:
    a. installs the @vitest/browser + provider package + adds @vitest/browser/providers/{name} to tsconfig

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: browserIssues and PRs related to the browser runnerp2-nice-to-haveNot breaking anything but nice to have (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions