make 'assert.calls' short circuit on function call
This commit is contained in:
parent
f0291d30d7
commit
d4ac9b4024
@ -84,12 +84,13 @@ assert.length = function(actual, expectedLength) {
|
||||
|
||||
var expect = function(callback) {
|
||||
var executed = false;
|
||||
setTimeout(function() {
|
||||
var id = setTimeout(function() {
|
||||
assert.ok(executed, "Expected execution never fired");
|
||||
}, 1000)
|
||||
|
||||
return function(err, queryResult) {
|
||||
executed = true;
|
||||
clearTimeout(id);
|
||||
assert.ok(true);
|
||||
callback.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user