test: cleanup worker function
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 5 Apr 2023 13:36:11 +0000 (15:36 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 5 Apr 2023 13:36:11 +0000 (15:36 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
benchmarks/benchmarks-utils.js
tests/test-utils.js

index e6abe96d5b1e065c07b709bd83c37095e9996935..6eed668bd16b33d9f7f6598ed2a680285d884e36 100644 (file)
@@ -7,7 +7,7 @@ async function runPoolifierTest (pool, { tasks, workerData }) {
       pool
         .execute(workerData)
         .then(() => {
-          executions++
+          ++executions
           if (executions === tasks) {
             return resolve({ ok: 1 })
           }
index 6d3592c1b5d2e2798c00b95fe213c1c630370c96..894471697cb42cc408c906021ee28e87147fcfbc 100644 (file)
@@ -77,9 +77,8 @@ class TestUtils {
   static factorial (n) {
     if (n === 0) {
       return 1
-    } else {
-      return TestUtils.factorial(n - 1) * n
     }
+    return TestUtils.factorial(n - 1) * n
   }
 
   static executeWorkerFunction (data) {