fix: apply browser CLI options only if the project has the browser set in the config already#7984
Conversation
…nfiguraton set in the config already
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
If user config doesn't have the browser setup already (an object without
enabled: false), then they don't affect the config at all. Vitest will throw an error [...]
Is this intentional breaking change? Browser mode is experimental, so yes, it is allowed within non-major semver update.
So for example previously vitest --browser --browser.name=chromium --browser.provider=playwright without any config file worked, now it throws an error.
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
Yes, this is intentional breaking change. |
Description
This PR changes how
--browserCLI flags (and API options) affect configuration. If user config doesn't have the browser setup already (an object withoutenabled: false), then they don't affect the config at all. Vitest will throw an error if no projects define the browser config, but the--browserCLI option was set. The--browser.enabledstill works the same way and will override options even if the config hasenabled: false.Hopefully, we can make simplify this when Vite 7 is out.
This PR also fixes a regression from 3.1.3 when
extend: truewouldn't correctly extend the browser configuration.Fixes #7944
Fixes #7964
Note
This PR needs to be backported to 3.1.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.