Open aaaaahaaaaa opened 5 years ago
Okay, not sure about mocking them in jest. But I usually just create a new configure store in the test and pass it in an array. Much like when we ssr and the server passes its request path. That’s just an array and you can add more entries to it.
What are you trying to test?
I think the issue is that you are trying to assign to an imported module object, and probably running into a limitation/feature of the object babel etc creates to represent a module with multiple exports. redux-first-router
doesn't control what what kind object you get when you do
import * from 'redux-first-router';
If you're trying to test your own app, I can see two options:
redux-first-router
, e.g. testing reducers, selectors, etc separately with particular actions and states. (plus maybe a few e2e tests in a simulated browser, in which case you wouldn't need to mock out history).
Hi. What would be the correct way to mock the
history
getter in order not to get the following error withjest
?I tried to use both:
Or
But I get the following errors respectively:
Seems like a very simple problem but I'm struggling there.