visionmedia/mocha — pull request #392 by domenic (2012-04-17 01:43:26+00:00)
Title: Save references to time globals so Sinon doesn't mess with them.

All the modules that use timer references now have the prologue

```javascript
/**
* Save timer references to avoid Sinon interfering (see GH-237).
*/

var Date = global.Date
, setTimeout = global.setTimeout
, setInterval = global.setInterval
, clearTimeout = global.clearTimeout
, clearInterval = global.clearInterval;
```

Most of them only use `Date` or `setTimeout`/`clearTimeout` but I figured this would be more future-friendly. It's a bit annoying that you have to remember this in any new files (maybe it should be in all modules even if they don't use timers yet? bleh).

I also added a test for this but it's kind of lame. Let me know what you think.

Closes #237 and supercedes #320.