Here is how I do in these cases (approximately):
function timeout(assert,to,error){ var done = assert.async(); var a = setTimeout(function(){ assert.equal(to,undefined,error); done(); },to); return function(){ done(); clearTimeout(a); }; }
then you can:
... var done = timeout(assert,2000,"not joined"); r.join(function(data){ assert.ok(true,"join confirmed"); done(); })
You can use the function timeout to timeout(assert,to,toCB) and execute toCB instead of my assert.equal dummy
FxIII source share