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
Mocking of custom mutations created via createMutation factory is impossible to mock while createJsonMutation instance is mocking good.
constcustomMutation=createMutation({effect: createEffect(async()=>({fileUrl: 'mock-url-valid-image.jpg',})),contract: zodContract(MutationDataSchema),});it('json query should be mocked even if mutation also been mocked',async()=>{constscope=fork({handlers: [[jsonQuery.__.executeFx,()=>Promise.resolve({id: 1,name: 'test',}satisfiesQueryData),],// If comment this test passes[customMutation.__.executeFx,()=>Promise.resolve({fileUrl: 'mock-url-valid-image.jpg',}),],],});awaitallSettled(jsonQuery.start,{ scope });expect(scope.getState(jsonQuery.$error)).toBeNull();expect(scope.getState(jsonQuery.$data)).toEqual({id: 1,name: 'test',});});
Also there are other cases described in stackblitz
The text was updated successfully, but these errors were encountered:
Mocking of custom mutations created via
createMutation
factory is impossible to mock whilecreateJsonMutation
instance is mocking good.Also there are other cases described in stackblitz
The text was updated successfully, but these errors were encountered: