Posts

Testing React connected functional components with typescript

I was never fan of tests on front-end, but fortunately it changed over time. I see big value in having automated tests regarding functionality of components. By that I mean checking if our state is correctly updated and our functions and requests are executed in proper sequence. I don't like checking exact rendering style (except that component can render without error), so testing snapshots or checking positions is not for me.  Starting with React I was fond of functional components and their hooks, and still I prefer it over class components. When I started testing there always seems to be a lot of problems and questions about how to check state of functional component or how to check if our redux store has been updated. Searching through web I've seen many topics and not answered questions, but after some time I managed to find good hybrid solution - connecting hints from many repositories and discussions. That's why I wanted to share it, to provide one source for f