New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Showing where the error is with the expected actions assertion #7
Comments
Definitely agree with this. It's very hard to know what went wrong and it's not obvious where I can place a console log to see what actually occurred. Would be great if there was some way to see what actions were fired vs what I was expecting to fire. Here is a specific example. In my test I have:
Which was timing out. The issue is that my action actually fires with an
If there was some way to know what actions were fired inside the mockStore, it would have been very easy to see what's wrong as you could visually see the expected vs the actual result. |
Which version are you both running? |
v0.0.4 |
Can you try v0.0.3, I think that v0.0.4 introduced that bug. |
@arnaudbenard need help on this? |
Interesting, switching back to v0.0.3 I do now see the diff with the expected actions as hoped. However with 0.0.3, another test that involves actions triggered after an error has been caught in a promise (part of an invalid login test) is failing where it was passing with 0.0.4 |
In the test though I’m not sure how to properly catch the failing mock test and test it’s error state
The tiny tweak in my pull request fixes the issues I was having when testing my app. However, I'm not sure how to properly test the test in the redux-mock-store tests! |
+1, I am experiencing the same issue and can confirm that switching back to 0.0.3. I had spent a while trying to figure out if one of my own tests passing was related to my usage of nock or fetch, but this is indeed now correctly failing. In my case, with v0.0.4, running mocha with |
In the test though I’m not sure how to properly catch the failing mock test and test it’s error state
Fixed in |
Firstly this library is proving to be very useful when testing my app, so many thanks!
One thing I have found is that if there is a mismatch with the expected actions in my test and the actual code then it can be tricky to find exactly where the problem is - typically the mocha test just times out because the done callback hasn't been triggered.
Is there a way to log the difference between expected and actual actions called?
The text was updated successfully, but these errors were encountered: