title: how to unit-test setInterval in karma angularjs
body: <pre><code>app.directive('shuffleBlocks', function($timeout){
      return {
          link: function(sco,ele,att){
              if (itemCnt &lt;= 1) return;
  
              /*Trigger function*/
              function triggerEvent(){
                  ...
              }
              ele.bind('click', triggerEvent);
  
              setInterval(triggerEvent, 5000);
          }
      }
  })
  </code></pre>
  
  <p>here I wrote the test</p>
  
  <pre><code>        var elem = '&lt;div shuffle-blocks&gt;&lt;div&gt;';
          elem = mockCompile(elem)(rootScope.$new());
          setInterval(function(){
              expect(......).toBe(....)
          });
  </code></pre>
  
  <p>Obviously this is not the right method,
  does anyone know how to test $timeout and setInterval in karma?</p>