Skip to content

Commit

Permalink
Saving timer references to avoid Sinon interfering.
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed Apr 17, 2012
1 parent 98aad6e commit 4c160d7
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bin/_mocha
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ var program = require('commander')
, join = path.join
, cwd = process.cwd();

/**
* 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;

/**
* Files.
*/
Expand Down
10 changes: 10 additions & 0 deletions lib/reporters/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
var tty = require('tty')
, diff = require('diff');

/**
* 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;

/**
* Check if both stdio streams are associated with a tty.
*/
Expand Down
10 changes: 10 additions & 0 deletions lib/reporters/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ var Base = require('./base')
, Progress = require('../browser/progress')
, escape = utils.escape;

/**
* 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;

/**
* Expose `Doc`.
*/
Expand Down
10 changes: 10 additions & 0 deletions lib/reporters/xunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ var Base = require('./base')
, utils = require('../utils')
, escape = utils.escape;

/**
* 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;

/**
* Expose `XUnit`.
*/
Expand Down
10 changes: 10 additions & 0 deletions lib/runnable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
var EventEmitter = require('events').EventEmitter
, debug = require('debug')('runnable');

/**
* 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;

/**
* Expose `Runnable`.
*/
Expand Down

0 comments on commit 4c160d7

Please sign in to comment.