Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Agriculture-Intelligence/msw-vitest-browser-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vitest Browser + MSW

Mock Service Worker usage example with Vitest in browser mode.

When the vitest environment is setup with ANY vi.mock calls, it appears to disrupt the expected functionality of the worker, leading to intercepted calls not being properly mocked. Notice how the downloadData method will fail with [ERROR] 18:46.980 xhr-http-handler - Network Error when the vi.mock call is present, but will work as expected when it is removed.

About

MSW Vitest Browser bug report

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •