Open utterances-bot opened 1 year ago
my team for large saga-based project applies the same approach as "recent approach for thunks": real store, dispatching specific actions to get initial setup, mocking network layer, checking against UI. Pretty handful.
The only thing we did run into - but finally have overcome - sagaMiddleware.run() was declared globally, outside configureStore()
initializer. So even when we created store separately for each tests, sagas from previous tests which were not finished yet, interfered. But after moving saga initialization inside the store initializer, everything is fine
Blogged Answers: The Evolution of Redux Testing Approaches · Mark's Dev Blog
https://blog.isquaredsoftware.com/2021/06/the-evolution-of-redux-testing-approaches/