From 5e095f699e2f7253cd151c0a829dd020c78d2487 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 42532543529087..1a4a1b8bf2af03 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', 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.