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
Relatively new to MSW so I may just get this flat out wrong in terms of trying to use the tool. So I figured id ask to try and get some context on why im wrong if I am or if the improvement could be useful.
I have a msw that is set up before a test runs that returns a and url / for example. In my test I have a mutation that changes the return value so now I want a' to be returned from that point on and I do a refetch at /. I have this test that runs the mutation in a nested describe suite. So im using server.use() to try and add additional logic that isnt needed in the other tests. Should i just set an individual server.use in every nested describe instead?
Since I think if .use is functioning as a prepend and MSW goes through the handlers right to left. if i put the a' handler in the use. that will be the handler called first and not the initial handler thats used to set up the server which i expect to run first.
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
-
Relatively new to MSW so I may just get this flat out wrong in terms of trying to use the tool. So I figured id ask to try and get some context on why im wrong if I am or if the improvement could be useful.
I have a msw that is set up before a test runs that returns
a
and url/
for example. In my test I have a mutation that changes the return value so now I wanta'
to be returned from that point on and I do a refetch at/
. I have this test that runs the mutation in a nested describe suite. So im using server.use() to try and add additional logic that isnt needed in the other tests. Should i just set an individual server.use in every nested describe instead?Since I think if .use is functioning as a prepend and MSW goes through the handlers right to left. if i put the
a'
handler in the use. that will be the handler called first and not the initial handler thats used to set up the server which i expect to run first.Beta Was this translation helpful? Give feedback.
All reactions