Skip to content

Commit

Permalink
Merge pull request #1522 from schmuli/fix-timers
Browse files Browse the repository at this point in the history
Updated timers for limited execution environment
  • Loading branch information
dignifiedquire committed Jul 31, 2015
2 parents 04fb8de + 9cfc1cd commit 69cd909
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ var di = require('di')
var util = require('util')
var Promise = require('bluebird')

var root = global || window || this

var cfg = require('./config')
var logger = require('./logger')
var constant = require('./constants')
Expand Down Expand Up @@ -72,7 +74,10 @@ var Server = function (cliOptions, done) {
reporter: ['factory', reporter.createReporters],
capturedBrowsers: ['type', BrowserCollection],
args: ['value', {}],
timer: ['value', {setTimeout: setTimeout, clearTimeout: clearTimeout}]
timer: ['value', {
setTimeout: function () { return setTimeout.apply(root, arguments)},
clearTimeout: function (timeoutId) { clearTimeout(timeoutId)}
}]
}]

// Load the plugins
Expand Down

0 comments on commit 69cd909

Please sign in to comment.