We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
setTimeout
1 parent 7ea6373 commit f2351caCopy full SHA for f2351ca
lib/test.js
@@ -12,6 +12,7 @@ var nextTick = typeof setImmediate !== 'undefined'
12
? setImmediate
13
: process.nextTick
14
;
15
+var safeSetTimeout = setTimeout;
16
17
inherits(Test, EventEmitter);
18
@@ -119,7 +120,7 @@ Test.prototype.plan = function (n) {
119
120
Test.prototype.timeoutAfter = function(ms) {
121
if (!ms) throw new Error('timeoutAfter requires a timespan');
122
var self = this;
- var timeout = setTimeout(function() {
123
+ var timeout = safeSetTimeout(function() {
124
self.fail('test timed out after ' + ms + 'ms');
125
self.end();
126
}, ms);
0 commit comments