Skip to content

Commit e08113e

Browse files
cjihriggibfahn
authored andcommitted
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: #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]>
1 parent fd3f89a commit e08113e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ process.on('warning', common.mustCall((warning) => {
1919
}));
2020

2121
e.on('event-type', function() {});
22-
e.on('event-type', function() {});
22+
e.on('event-type', function() {}); // Trigger warning.
23+
e.on('event-type', function() {}); // Verify that warning is emitted only once.

0 commit comments

Comments
 (0)