better error message on timeout firing because event wasn't raised in assert.raises

This commit is contained in:
brianc 2010-10-24 23:18:23 -05:00
parent 59aed65b78
commit 6600bc603c

View File

@ -19,7 +19,9 @@ assert.same = function(actual, expected) {
assert.raises = function(item, eventName, callback) {
var called = false;
var id = setTimeout(function() {
test("Should have called " + eventName, function() {
assert.ok(called, "Expected '" + eventName + "' to be called.")
});
},1000);
item.once(eventName, function() {