refactor: convert internal benchmark code to ESM
[poolifier.git] / tests / pools / abstract / abstract-pool.test.js
index fc386f375513cbfe35e9eb220ee5598e1e562008..b6219ce954e21c878df1c2a67ce0e86031ceddc0 100644 (file)
@@ -329,6 +329,21 @@ describe('Abstract pool test suite', () => {
         median: false
       }
     })
+    expect(() =>
+      pool.setWorkerChoiceStrategyOptions('invalidWorkerChoiceStrategyOptions')
+    ).toThrowError(
+      'Invalid worker choice strategy options: must be a plain object'
+    )
+    expect(() =>
+      pool.setWorkerChoiceStrategyOptions({ weights: {} })
+    ).toThrowError(
+      'Invalid worker choice strategy options: must have a weight for each worker node'
+    )
+    expect(() =>
+      pool.setWorkerChoiceStrategyOptions({ measurement: 'invalidMeasurement' })
+    ).toThrowError(
+      "Invalid worker choice strategy options: invalid measurement 'invalidMeasurement'"
+    )
     await pool.destroy()
   })