Skip to content

Commit

Permalink
test: verify listener leak is only emitted once
Browse files Browse the repository at this point in the history
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: #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>
  • Loading branch information
cjihrig committed Apr 21, 2017
1 parent 58066d1 commit 5e095f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/parallel/test-event-emitter-max-listeners-warning.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ process.on('warning', common.mustCall((warning) => {
}));

e.on('event-type', common.noop);
e.on('event-type', common.noop);
e.on('event-type', common.noop); // Trigger warning.
e.on('event-type', common.noop); // Verify that warning is emitted only once.

0 comments on commit 5e095f6

Please sign in to comment.