Fix tests
[poolifier.git] / tests / pools / selection-strategies / worker-choice-strategy-context.test.js
index c30bda737d35637f2b88020f0ed8441a0fb5c020..46ac017c223687891b0eccd438892ea1a22f6c51 100644 (file)
@@ -61,11 +61,11 @@ describe('Worker choice strategy context test suite', () => {
       }
     )
     workerChoiceStrategyContext.workerChoiceStrategy = WorkerChoiceStrategyStub
-    const worker = workerChoiceStrategyContext.execute()
+    const chosenWorker = workerChoiceStrategyContext.execute()
     expect(
-      workerChoiceStrategyContext.workerChoiceStrategy.choose.calledOnce
+      workerChoiceStrategyContext.getWorkerChoiceStrategy().choose.calledOnce
     ).toBe(true)
-    expect(worker).toBe('worker')
+    expect(chosenWorker).toBe('worker')
   })
 
   it('Verify that execute() return the worker chosen by the strategy with dynamic pool', () => {
@@ -79,11 +79,11 @@ describe('Worker choice strategy context test suite', () => {
       }
     )
     workerChoiceStrategyContext.workerChoiceStrategy = WorkerChoiceStrategyStub
-    const worker = workerChoiceStrategyContext.execute()
+    const chosenWorker = workerChoiceStrategyContext.execute()
     expect(
-      workerChoiceStrategyContext.workerChoiceStrategy.choose.calledOnce
+      workerChoiceStrategyContext.getWorkerChoiceStrategy().choose.calledOnce
     ).toBe(true)
-    expect(worker).toBe('worker')
+    expect(chosenWorker).toBe('worker')
   })
 
   it('Verify that setWorkerChoiceStrategy() works with ROUND_ROBIN and fixed pool', () => {