-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: apply browser CLI options only if the project has the browser set in the config already #7984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
--browser
CLI 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--browser
CLI option was set. The--browser.enabled
still 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: true
wouldn'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.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.