How to unit test the timer functions – setTimeout and setInterval in React using jest

Learn how to write unit test cases for timer functions like settimeout and setinterval in React using jest and enzyme library.