From 954cf0b821c342406b95a40958ddbe5fa6bb77d8 Mon Sep 17 00:00:00 2001 From: EunChan Park Date: Wed, 9 Oct 2019 22:18:01 +0900 Subject: [PATCH] Fix HTMLCollection iteration to make unhide function work as expected (#4051) --- lib/reporters/html.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/reporters/html.js b/lib/reporters/html.js index d3f488a941..70e8698407 100644 --- a/lib/reporters/html.js +++ b/lib/reporters/html.js @@ -357,8 +357,8 @@ function hideSuitesWithout(classname) { */ function unhide() { var els = document.getElementsByClassName('suite hidden'); - for (var i = 0; i < els.length; ++i) { - els[i].className = els[i].className.replace('suite hidden', 'suite'); + while (els.length > 0) { + els[0].className = els[0].className.replace('suite hidden', 'suite'); } }