Mock a function or setState using jest in ReactJS.

lets assume that we need to mock setStatus(). So, in test file we will mock by using jest as follows.


Discover more from Learners Store

Subscribe to get the latest posts sent to your email.

Leave a comment