Permalink
Browse files

test: improve coverage on removeListeners functions

PR-URL: #11140
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information...
matsuda-koushi authored and italoacasas committed Feb 3, 2017
1 parent 8547871 commit e9f6bc60e9fd504a1cbea3b3293147102d998c36
@@ -82,3 +82,9 @@ function listener() {}
const ee = new events.EventEmitter();
assert.deepStrictEqual(ee, ee.removeAllListeners());
}
+
+{
+ const ee = new events.EventEmitter();
+ ee._events = undefined;
+ assert.strictEqual(ee, ee.removeAllListeners());
+}
@@ -128,3 +128,11 @@ assert.throws(() => {
ee.removeListener('foo', null);
}, /^TypeError: "listener" argument must be a function$/);
+
+{
+ const ee = new EventEmitter();
+ const listener = () => {};
+ ee._events = undefined;
+ const e = ee.removeListener('foo', listener);
+ assert.strictEqual(e, ee);
+}

0 comments on commit e9f6bc6

Please sign in to comment.