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
Middlewares can be triggered via action dispatch similar to reducer.
A basic example would be to do a simple action dispatch and using Mockito to check if certain methods are called or not(using Mockito.verify).
Building up on previous step, we could mock certain methods called inside middleware(like mocking a network/db call) and which would then do another dispatch to reducer and produce a new state.
I'm pretty familiar with Mockito and unit testing, but I'm having a hard time seeing how this suggestion is a unit test. It sounds like more of an example of an integration test, where firing all of the related actions should eventually trigger the middleware. Is there an example you can provide?
How would you go about testing some of your middlewares?
The text was updated successfully, but these errors were encountered: