ability to supply custom message to assert.emits
This commit is contained in:
parent
699ef7b294
commit
ca851e40f6
@ -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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user