Fix closure issue in UTs utils
authorJérôme Benoit <jerome.benoit@sap.com>
Thu, 17 Nov 2022 22:53:46 +0000 (23:53 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Thu, 17 Nov 2022 22:53:46 +0000 (23:53 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
tests/test-utils.js

index 116b1942b96829273eedb2d08ff83691ff61aa6f..f650af789867c1e87d56e963a210a9f4320a02c0 100644 (file)
@@ -2,8 +2,8 @@ const { WorkerFunctions } = require('./test-types')
 
 class TestUtils {
   static async waitExits (pool, numberOfExitEventsToWait) {
-    let exitEvents = 0
     return new Promise(resolve => {
+      let exitEvents = 0
       pool.workers.forEach(w => {
         w.on('exit', () => {
           exitEvents++