Supports browser mode for custom provider module #7316
Labels
enhancement: pending triage
feat: browser
Issues and PRs related to the browser runner
feat: coverage
Issues and PRs related to the coverage feature
Clear and concise description of the problem
It doesn't automatically switch to browser mode for custom provider module. for example:
It works if the browser mode is manually used
Related issue: cenfun/vitest-monocart-coverage#8
Suggested solution
For build-in modules 'v8' and 'istanbul', the solution is below
see source
So can we do something similar for custom module?
Possible questions:
1, What if customProviderModule is a file path like
./path-to/my-file.js
?2, What if customProviderModule does not support browser mode?
Alternative
No response
Additional context
If it cannot be supported, should we consider restructuring the custom module architecture, since vitest@3 has just been released and we still have the opportunity?
I personally think we should separate the code for browser mode and Node.js mode. Otherwise, it will lead to very high complexity and is prone to errors.
Validations
The text was updated successfully, but these errors were encountered: