React Unit test case issue with MSW mock service provider
I have been doing React+TS unit testing , where I have bene mocking API response using MSW mock service provider
I am able to get mock response in my redux slice but it is not updating respective state and I am not able to test respective components ..
Anybody has gone through this if yes then could you please help me on this .
I Have created React application using CRA.
12 Replies
I have been trying various workaround but still bad luck..
I got few suggestion like do not use CRA , may be it is causing the issue.
so i am kind of confuse , do i need to re-create my application using react framework like Next.js or something ??
Your views and suggestion welcomes
Stack Overflow
React Unit Test : Redux State is not getting updated with mock resp...
Writing unit tests for my React (Typescript) application where I am using MSW service for Mocking response
For state management using Redux toolkit .
The issue is I am able to get mocked Response ...
You can bump your post occasionally, but otherwise you'll have to just be patient
not every question will be answered, people here volunteer their time so there's no guarantee
and by occasionally, I mean once a day at the very most
when yu say bump up what you wan to say,.. repost or update ??
just post a message in this thread, it'll push it back to the top
gotcha
you might also get a better response on a more javascript focused server though. This is a server mostly focused on CSS with a little javascript. And before you ask, no I don't have any recommendations
okay
Do you have any react server link or channel ??
like I said, no
np brother
maybe try codinggarden
okay thanks