await pool.destroy()
})
- it.only('Verify that reset() resets internals', () => {
+ it('Verify that reset() resets internals', () => {
const strategy = new WeightedRoundRobinWorkerChoiceStrategy(pool)
const workersTaskRunTimeClearStub = sinon
.stub(strategy.workersTaskRunTime, 'clear')
workerChoiceStrategyContext.workerChoiceStrategy = WorkerChoiceStrategyStub
const chosenWorker = workerChoiceStrategyContext.execute()
expect(
- workerChoiceStrategyContext.workerChoiceStrategy.choose.calledOnce
+ workerChoiceStrategyContext.getWorkerChoiceStrategy().choose.calledOnce
).toBe(true)
expect(chosenWorker).toBe('worker')
})
workerChoiceStrategyContext.workerChoiceStrategy = WorkerChoiceStrategyStub
const chosenWorker = workerChoiceStrategyContext.execute()
expect(
- workerChoiceStrategyContext.workerChoiceStrategy.choose.calledOnce
+ workerChoiceStrategyContext.getWorkerChoiceStrategy().choose.calledOnce
).toBe(true)
expect(chosenWorker).toBe('worker')
})