title: How can I simulate the passing of time in Mocha tests so that setTimeout callbacks are called?
body: <p>I need to test JavaScript code that relies on <a href="http://www.w3schools.com/jsref/met_win_settimeout.asp">setTimeout</a> in order to perform periodic tasks. How can I from my Mocha tests simulate the passing of time so that setTimeout callbacks gets called?</p>
  
  <p>I am basically asking for functionality similar to <a href="http://pivotal.github.io/jasmine/">Jasmine's Mock Clock</a>, which allows you to advance JavaScript time by a number of ticks.</p>