X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Ftest-utils.js;h=6d3592c1b5d2e2798c00b95fe213c1c630370c96;hb=4a2991331aa9ab339cf110856e8ce4752a0b3400;hp=7314f261dffee839dd15e44b26eece688920ecfa;hpb=5a94e4b950eaf2234e07f87261ddea1482e839c6;p=poolifier.git diff --git a/tests/test-utils.js b/tests/test-utils.js index 7314f261..6d3592c1 100644 --- a/tests/test-utils.js +++ b/tests/test-utils.js @@ -4,8 +4,8 @@ class TestUtils { static async waitExits (pool, numberOfExitEventsToWait) { return new Promise(resolve => { let exitEvents = 0 - for (const value of pool.workers.values()) { - value.worker.on('exit', () => { + for (const workerItem of pool.workers) { + workerItem.worker.on('exit', () => { ++exitEvents if (exitEvents === numberOfExitEventsToWait) { resolve(exitEvents)