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 <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
  • Loading branch information
cjihrig authored and MylesBorins committed Jul 11, 2017
1 parent 046bd79 commit 361bc84
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', 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.

0 comments on commit 361bc84

Please sign in to comment.