Switch forEach loop to for of syntax
authorJérôme Benoit <jerome.benoit@sap.com>
Thu, 17 Nov 2022 23:07:39 +0000 (00:07 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Thu, 17 Nov 2022 23:07:39 +0000 (00:07 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
tests/test-utils.js

index f650af789867c1e87d56e963a210a9f4320a02c0..84bec7e560f7eae6a7bd9a420338b63ff866bec5 100644 (file)
@@ -4,14 +4,14 @@ class TestUtils {
   static async waitExits (pool, numberOfExitEventsToWait) {
     return new Promise(resolve => {
       let exitEvents = 0
-      pool.workers.forEach(w => {
-        w.on('exit', () => {
+      for (const worker of pool.workers) {
+        worker.on('exit', () => {
           exitEvents++
           if (exitEvents === numberOfExitEventsToWait) {
             resolve(exitEvents)
           }
         })
-      })
+      }
     })
   }