From: Jérôme Benoit Date: Thu, 17 Nov 2022 23:07:39 +0000 (+0100) Subject: Switch forEach loop to for of syntax X-Git-Tag: v2.3.8~90 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=996834996130d87aeb1a029186808f68db9f7031;p=poolifier.git Switch forEach loop to for of syntax Signed-off-by: Jérôme Benoit --- diff --git a/tests/test-utils.js b/tests/test-utils.js index f650af789..84bec7e56 100644 --- a/tests/test-utils.js +++ b/tests/test-utils.js @@ -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) } }) - }) + } }) }