From 361bc845dc5d90f9ffc32a5c9102aa7a1c8b772b Mon Sep 17 00:00:00 2001 From: cjihrig Date: Tue, 18 Apr 2017 21:30:53 -0400 Subject: [PATCH] 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 Reviewed-By: Luigi Pinca Reviewed-By: Benjamin Gruenbaum Reviewed-By: Santiago Gimeno Reviewed-By: James M Snell Reviewed-By: Jeremiah Senkpiel --- test/parallel/test-event-emitter-max-listeners-warning.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-event-emitter-max-listeners-warning.js b/test/parallel/test-event-emitter-max-listeners-warning.js index df363e43d9cbb7..21f4ee0cc6bcde 100644 --- a/test/parallel/test-event-emitter-max-listeners-warning.js +++ b/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.