Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit dd6b79297e4522593028439c564a876fbd55e8d8 1 parent a927944
@3rd-Eden authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 test/simple/test-event-emitter-once.js
View
8 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);
});
Please sign in to comment.
Something went wrong with that request. Please try again.