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
Since the version 2.1.5, we cannot mock anymore our http calls with undici MockAgent due to the bug fix:
vitest:
Use fetch() implementation from happy-dom - by @capricorn86 in #6879(3c56f)
Reproduction
import{MockAgent,setGlobalDispatcher}from'undici';describe('Test mock fetch with undici',()=>{it('should success',async()=>{constmockAgent=newMockAgent();mockAgent.disableNetConnect();setGlobalDispatcher(mockAgent);constapiMockPool=mockAgent.get('https://localhost');apiMockPool.intercept({method: 'GET',path: '/api/v1/test'}).reply(200,{success: true}).persist();constresult=awaitfetch('https://localhost/api/v1/test');expect(result).toBeDefined();});
Describe the bug
Since the version 2.1.5, we cannot mock anymore our http calls with undici MockAgent due to the bug fix:
vitest:
Use fetch() implementation from happy-dom - by @capricorn86 in #6879 (3c56f)
Reproduction
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: