test: add test case for listeners

PR-URL: https://github.com/nodejs/node/pull/56282
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
pull/56318/head
origranot 2024-12-17 10:27:59 +02:00 committed by Luigi Pinca
parent 58b72040f2
commit a85ef6a04a
1 changed files with 5 additions and 0 deletions

View File

@ -86,6 +86,11 @@ function listener4() {
assert.deepStrictEqual(ee.listeners('foo'), []);
}
{
const ee = new events.EventEmitter();
assert.deepStrictEqual(ee.listeners(), []);
}
{
class TestStream extends events.EventEmitter {}
const s = new TestStream();