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'm currently using msw well, but I don't have a clue what to do about certain jest taunts. So I'm looking for help.
constsomeData=jest.fn();jest.spyOn(window,"fetch").mockImplementation(url=>{switch(url){case: "someUrl":
returnsomeData();default: wantMsw;// <- I'd like to work on this part to msw }});
...
expect(someData).toHaveBeenCalledTimes(1);
I'm originally using msw, so i don't have to mock fetch
But I'm inevitably mokcing fetch because I'm currently couting the numbers that certain url called,
However, since there is no need to mock all api, I would like to delegate the task to the handler of msw again in the default value of switch Will it be possible ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm currently using msw well, but I don't have a clue what to do about certain jest taunts. So I'm looking for help.
I'm originally using msw, so i don't have to mock fetch
But I'm inevitably mokcing fetch because I'm currently couting the numbers that certain url called,
However, since there is no need to mock all api, I would like to delegate the task to the handler of msw again in the default value of switch Will it be possible ?
Beta Was this translation helpful? Give feedback.
All reactions