Skip to content

Commit f8d5659

Browse files
committed
Add a test for all exposed EventEmitter methods.
1 parent b4181fb commit f8d5659

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

test/index_test.js

+13-9
Original file line numberDiff line numberDiff line change
@@ -728,15 +728,19 @@ describe("Mitm", function() {
728728
})
729729
})
730730

731-
describe(".prototype.addListener", function() {
732-
it("must be an alias to EventEmitter.prototype.addListener", function() {
733-
Mitm.prototype.addListener.must.equal(EventEmitter.prototype.addListener)
734-
})
735-
})
736-
737-
describe(".prototype.off", function() {
738-
it("must be an alias to EventEmitter.prototype.removeListener", function() {
739-
Mitm.prototype.off.must.equal(EventEmitter.prototype.removeListener)
731+
_.each({
732+
on: EventEmitter.prototype.on,
733+
once: EventEmitter.prototype.once,
734+
off: EventEmitter.prototype.removeListener,
735+
addListener: EventEmitter.prototype.addListener,
736+
removeListener: EventEmitter.prototype.removeListener,
737+
emit: EventEmitter.prototype.emit
738+
}, function(to, from) {
739+
describe(".prototype." + from, function() {
740+
it("must be an alias to EventEmitter.prototype", function() {
741+
Mitm.prototype.must.have.property(from, to)
742+
Mitm.prototype[from].must.be.a.function()
743+
})
740744
})
741745
})
742746
})

0 commit comments

Comments
 (0)