Skip to content

Commit ed25b25

Browse files
authored
Run web Vitest browser tests headless by default (#930)
## 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. ```ts 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 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent d895702 commit ed25b25

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

vitest.web.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ export default defineConfig({
133133
},
134134
browser: {
135135
enabled: true,
136+
// Run headless by default so the test runner never pops up a browser
137+
// window (locally Vitest would otherwise launch a headed browser; it only
138+
// defaults to headless in CI). Set BROWSER_HEADED=true to opt back into a
139+
// visible browser, e.g. for debugging.
140+
headless: process.env.BROWSER_HEADED !== "true",
136141
provider: playwright(),
137142
instances: [{ browser }],
138143
},

0 commit comments

Comments
 (0)