fix: do not throw when browser mode is used without explicit projects (#9801)#9938
fix: do not throw when browser mode is used without explicit projects (#9801)#9938oilater wants to merge 8 commits intovitest-dev:mainfrom
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
| if (this._cliOptions.browser?.enabled) { | ||
| const browserProjects = this.projects.filter(p => p.config.browser.enabled) | ||
| if (!browserProjects.length) { | ||
| if (!browserProjects.length && !this.config.browser?.instances?.length) { |
There was a problem hiding this comment.
This should not be needed because instances inject new projects
There was a problem hiding this comment.
@sheremet-va Could you review this when you have a chance?
|
I reverted my previous workaround When no browser section exists in the config file, So I fixed this by allowing the merge when resolving the root config ( Also added a fallback for I'm not sure this is the most fundamental fix, but let me know what you think. |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Description
Resolves #9801
This PR fixes an issue where Vitest throws an incorrect validation error when browser mode is enabled without an explicit
config.projects, even if validbrowser.instancesare provided.Implementation
Updated the browser validation logic to distinguish between workspace and non-workspace configurations.
config.projectsis not defined, browser mode is allowed as long as validbrowser.instancesare provided.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:.