Open JalilArfaoui opened 6 years ago
Issue on redux-observable
: https://github.com/redux-observable/redux-observable/issues/389
It's seems the problem is on redux-observable
side : https://github.com/redux-observable/redux-observable/issues/389#issuecomment-354623405
Do you want to request a feature or report a bug?
A bug I think, but not sure if it's
redux-observable
orredux-mock-store
who has the wrong behavior. So I will post in both repos.What is the current behavior?
When writing a single test with
jest
andredux-mock-store
, everything works as expected. But if I use themockStore
multiple times (in the same test or even in another), then the actions dispatched in any of the created stores are sent multiple times in the observable (but only once in the store, asstore.getActions()
states.Here's a reproduction repo : https://framagit.org/jalil/redux-observable-mock-store-duplicate
tldr;
This works :
This doesn't :
... and so on ...
What is the expected behavior?
I expect, as I use
replaceEpic
andmockStore
, and I use different jest tests, that one test should not affect another, and one mockStore should not affect another.So, I expect, even if I have multiple tests each one calling
mockStore()
, to have my epics receiving the right stream of actions.Which versions of redux-observable, and which browser and OS are affected by this issue? Did this work in previous versions of redux-observable?
My above reproduction code uses :
Thanks for your help.