ability to supply custom message to assert.emits

This commit is contained in:
brianc 2011-05-19 20:04:48 -05:00
parent 699ef7b294
commit ca851e40f6

View File

@ -27,11 +27,11 @@ assert.same = function(actual, expected) {
}; };
assert.emits = function(item, eventName, callback) { assert.emits = function(item, eventName, callback, message) {
var called = false; var called = false;
var id = setTimeout(function() { var id = setTimeout(function() {
test("Should have called " + eventName, function() { test("Should have called " + eventName, function() {
assert.ok(called, "Expected '" + eventName + "' to be called.") assert.ok(called, message || "Expected '" + eventName + "' to be called.")
}); });
},2000); },2000);