I'm currently investigating testing approaches for Redux/React based applications. I went through redux tutorial on testing, but still have questions:
-
Does it make sense to test plain action creators, that just return an object with
typeandpayloadfield? For me, it smells likegetter/settertests in OO applications. -
In a case of testing async action, should you check that corresponding actions of success and are dispatched? Again, with HTTP requests mocked, it seems as just testing mocks containers, not application behaviour.
-
Should testing focus in reducers, since they are responsible for state transitions, means for a behaviour of connected components?
-
Perhaps instead of testing redux guts of application, it should be tested more on a level of components? What aspects of component should be tested when? Are those tests fragile?
I'd like to hear some experience of people who use Redux/React in production and actively practicing testing.
Aucun commentaire:
Enregistrer un commentaire