Permalink
Browse files

Updated the event-emitter-once testcase with add & removal of a listener

  • Loading branch information...
3rd-Eden committed Mar 24, 2011
1 parent a927944 commit dd6b79297e4522593028439c564a876fbd55e8d8
Showing with 8 additions and 0 deletions.
  1. +8 −0 test/simple/test-event-emitter-once.js
@@ -35,6 +35,14 @@ e.emit('hello', 'a', 'b');
e.emit('hello', 'a', 'b');
e.emit('hello', 'a', 'b');
+var remove = function() {
+ assert.fail(1,0, 'once->foo should not be emitted', '!');
+};
+
+e.once('foo', remove);
+e.removeListener('foo', remove);
+e.emit('foo');
+
process.addListener('exit', function() {
assert.equal(1, times_hello_emited);
});

0 comments on commit dd6b792

Please sign in to comment.