Index: test/filterNotifier.js |
=================================================================== |
--- a/test/filterNotifier.js |
+++ b/test/filterNotifier.js |
@@ -45,16 +45,22 @@ |
function removeListener(listener) |
{ |
filterNotifier.off("foo", listener); |
} |
function compareListeners(test, testDescription, list) |
{ |
+ test.equal(filterNotifier.hasListeners(), list.length > 0, testDescription); |
+ test.equal(filterNotifier.hasListeners("foo"), list.length > 0, |
+ testDescription); |
+ |
+ test.equal(filterNotifier.hasListeners("bar"), false, testDescription); |
+ |
let result1 = triggeredListeners = []; |
filterNotifier.emit("foo", {bar: true}); |
let result2 = triggeredListeners = []; |
for (let observer of list) |
observer({bar: true}); |
test.deepEqual(result1, result2, testDescription); |