You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I was about to file an issue when I saw this one, so I'll add some extra context here 🙂
I think this is a good idea, not only for the reason mentioned in the description above, but also because it seems to conflict with other installs of msw, expecially when these are not the same version.
I'm currently using msw@2.2.14 fixed version, and every time I do an npm install, the mockServiceWorker.js generated by msw will be for the version defined in @vitest/browser (currently msw^2.7.3).
If I keep the one generated for 2.7.3, I will get issues in my tests, and if I keep the one generated for 2.2.14, I will get issues in my mocks 😅
I guess making msw a peer dependency (required or optional) could help solve this conflict?
Clear and concise description of the problem
@vitest/browser
always installs MSW even if module mocking is not used.Suggested solution
Instead of always installing MSW, maybe we should throw an error on
vi.mock
and ask for an MSW installation.Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: