Created
December 5, 2011 20:11
-
-
Save trentm/1435149 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: /Users/trentm/src/node-tap/lib/tap-harness.js | |
index 5083aba..2d7120f 100644 | |
--- a/lib/tap-harness.js | |
+++ b/lib/tap-harness.js | |
@@ -159,11 +165,13 @@ Harness.prototype.test = function test (name, conf, cb) { | |
if (isNaN(conf.timeout)) conf.timeout = 30000 | |
var t = new this._Test(this, name, conf) | |
if (cb) { | |
- if (!isNaN(conf.timeout) && isFinite(conf.timeout)) { | |
- var timer = setTimeout(t.timeout.bind(t), conf.timeout) | |
- t.on("end", clearTimeout.bind(null, timer)) | |
- } | |
//console.error("attaching cb to ready event") | |
+ t.on("ready", function () { | |
+ if (!isNaN(conf.timeout) && isFinite(conf.timeout)) { | |
+ var timer = setTimeout(this.timeout.bind(this), conf.timeout) | |
+ this.on("end", clearTimeout.bind(null, timer)) | |
+ } | |
+ }) | |
t.on("ready", cb.bind(t, t)) | |
// proxy the child results to this object. | |
//t.on("result", function (res) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tapjs/tapjs#29