Skip to content

Run web Vitest browser tests headless by default#930

Merged
peter-leonov-ch merged 1 commit into
mainfrom
copilot/make-vitest-headless
Jun 29, 2026
Merged

Run web Vitest browser tests headless by default#930
peter-leonov-ch merged 1 commit into
mainfrom
copilot/make-vitest-headless

Conversation

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

The web Vitest suite (vitest.web.config.ts) left browser.headless unset, so Vitest launched a visible browser window when run locally and only fell back to headless in CI. This makes the web tests open a browser window on every local run.

Changes

  • Default to headless: set browser.headless based on a new BROWSER_HEADED env var, so the runner stays headless unless explicitly opted out.
browser: {
  enabled: true,
  // headless by default; set BROWSER_HEADED=true for a visible browser (debugging)
  headless: process.env.BROWSER_HEADED !== "true",
  provider: playwright(),
  instances: [{ browser }],
},

Checklist

Delete items not relevant to your PR:

  • A human-readable description of the changes was provided to include in CHANGELOG

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@peter-leonov-ch
peter-leonov-ch marked this pull request as ready for review June 29, 2026 21:48
Copilot AI review requested due to automatic review settings June 29, 2026 21:48
@peter-leonov-ch
peter-leonov-ch enabled auto-merge (squash) June 29, 2026 21:48
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@peter-leonov-ch
peter-leonov-ch merged commit ed25b25 into main Jun 29, 2026
81 checks passed
@peter-leonov-ch
peter-leonov-ch deleted the copilot/make-vitest-headless branch June 29, 2026 21:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Vitest web/browser test configuration so local runs stay headless by default, avoiding a visible browser window unless explicitly requested for debugging.

Changes:

  • Set browser.headless explicitly in vitest.web.config.ts to be headless by default.
  • Add an opt-out via BROWSER_HEADED=true to run headed (visible) for debugging.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants