How to test componentDidUpdate()?

Posted by Jessica Taylor | Updated on

Want to test componentDidUpdate()? I am using a different approach but you can copy the idea. You need to make a change in the props, I used the setProps() function:

I can see the pink in the coverage tests page is gone in the componentDidUpdate after running the test.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers