Testing Effects: Testing the Success Case
Learn how to write unit testing code to handle the success case of the effects.
Introduction
The ProductsEffects
have been defined so that, when the loadProductsAction
is dispatched from our application, the loadProducts$
effect detects it by subscribing to the actions$
observable in lines 17–18. Then, in order to fetch the product data, our effects connect to the server in line 19. If the product data is successfully returned from the server, we have dispatched another action called getProductsAction()
in line 20.
Let’s unit test this success case in this lesson.
Get hands-on with 1400+ tech skills courses.