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
I think you can do this without changes to this library. You can write a function for your network layer that returns different invocations of getNetworkLayer
Network.create((operation,variables)=>{if(variables.email==="[email protected]"){// mock failed login test casereturngetNetworkLayer({
schema,mocks: {User: ()=>{thrownewError("login failed");}}})(operation,variables);}// mock successful login test casereturngetNetworkLayer({
schema,mocks: {User: ()=>({id: "123"})}})(operation,variables);});
Add a function that allow to change mock return in each test.
Use case:
Proposal:
mockResponseOnce
.The text was updated successfully, but these errors were encountered: