Posts by Laferu • 21 points
2 posts
-
1
votes1
answer37
viewsA: How to create a test for a screen that uses the same hook multiple times? React Testing Library
I solved by putting the mockImplementationOnce directly on this block of code that was outside the it() and removed those inside the it, leaving only the toHaveBeenNthCalledWith.…
-
1
votes1
answer37
viewsQ: How to create a test for a screen that uses the same hook multiple times? React Testing Library
I came across a test scenario in React where I need to hook twice. In this case I am using a hook called useGet() in two situations on the same page. Of all the times I have tried only the last…