Browse Source

test: verify listener leak is only emitted once

When a possible listener leak is detected, a warning is
emitted. This commit updates an existing test to verify that the
warning is only emitted once.

PR-URL: https://github.com/nodejs/node/pull/12502
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
v6.x
cjihrig 8 years ago
committed by Myles Borins
parent
commit
361bc845dc
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 3
      test/parallel/test-event-emitter-max-listeners-warning.js

3
test/parallel/test-event-emitter-max-listeners-warning.js

@ -19,4 +19,5 @@ process.on('warning', common.mustCall((warning) => {
}));
e.on('event-type', function() {});
e.on('event-type', function() {});
e.on('event-type', function() {}); // Trigger warning.
e.on('event-type', function() {}); // Verify that warning is emitted only once.

Loading…
Cancel
Save