title: Mock setInterval method in react using jest test cases
body: <p>I want to mock setInterval method and should cover the lines insed the getData method.
  Can someone please help me on this.</p>
  
  <pre><code>startInterval() {
      setInterval(() =&gt; this.getData(), this.state.timeInterval);
  }
  
  getData(){
   // i want to covet this lines
  }
  </code></pre>
  
  <p>I have tried as bellow</p>
  
  <pre><code>it('should call getTopIntentsSince', () =&gt; {
      jest.useFakeTimers();
      jest.runAllTicks();
  })
  </code></pre>