Skip to content

Conversation

@userquin
Copy link
Member

@userquin userquin commented Nov 7, 2025

Description

This PR adds the first session id to the url when starting the browser mode (terminal).

Looks like openBrowser (Vite) is able to open the browser using process.env.BROWSER and so we need to change the documentation; for example, I don't have Chromium installed, but I was running test/browser with PW and Chromimum, when switching to preview-provider the browser not being opened. Check the screenshot below, using set BROWSER=firefox (or running the new script nr test:browser:preview:firefox).

Vitest preview provider with Firefox

NOTE: I need to check preview provider at StackBlitz.

Is there a way to know what instance is running? There is no way to start the corresponding browser instance from the preview provider. Use this.project.config.browser.name

Resolves #issue-number

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 8, 2025

@vitest/browser

npm i https://pkg.pr.new/@vitest/browser@8977

@vitest/browser-playwright

npm i https://pkg.pr.new/@vitest/browser-playwright@8977

@vitest/browser-preview

npm i https://pkg.pr.new/@vitest/browser-preview@8977

@vitest/browser-webdriverio

npm i https://pkg.pr.new/@vitest/browser-webdriverio@8977

@vitest/coverage-istanbul

npm i https://pkg.pr.new/@vitest/coverage-istanbul@8977

@vitest/coverage-v8

npm i https://pkg.pr.new/@vitest/coverage-v8@8977

@vitest/expect

npm i https://pkg.pr.new/@vitest/expect@8977

@vitest/mocker

npm i https://pkg.pr.new/@vitest/mocker@8977

@vitest/pretty-format

npm i https://pkg.pr.new/@vitest/pretty-format@8977

@vitest/runner

npm i https://pkg.pr.new/@vitest/runner@8977

@vitest/snapshot

npm i https://pkg.pr.new/@vitest/snapshot@8977

@vitest/spy

npm i https://pkg.pr.new/@vitest/spy@8977

@vitest/ui

npm i https://pkg.pr.new/@vitest/ui@8977

@vitest/utils

npm i https://pkg.pr.new/@vitest/utils@8977

vitest

npm i https://pkg.pr.new/vitest@8977

@vitest/web-worker

npm i https://pkg.pr.new/@vitest/web-worker@8977

@vitest/ws-client

npm i https://pkg.pr.new/@vitest/ws-client@8977

commit: 3bb1314

@userquin
Copy link
Member Author

userquin commented Nov 8, 2025

We need to fix printBrowserBanner to show the proper sessionId, this PR using first session found (if any), check https://github.com/userquin/vitest-browser-mode-stackblitz

@userquin
Copy link
Member Author

userquin commented Nov 8, 2025

We need to show a warning in the temrinal when using preview provider with multiple browser instances, the first N - 1 launched browser instances won't run until get focused

@userquin userquin marked this pull request as draft November 8, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants