const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
fixedPool
)
- const WorkerChoiceStrategyStub = createStubInstance(
+ const workerChoiceStrategyStub = createStubInstance(
RoundRobinWorkerChoiceStrategy,
{
choose: stub().returns(0)
)
workerChoiceStrategyContext.workerChoiceStrategies.set(
workerChoiceStrategyContext.workerChoiceStrategy,
- WorkerChoiceStrategyStub
+ workerChoiceStrategyStub
)
const chosenWorkerKey = workerChoiceStrategyContext.execute()
expect(
const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
fixedPool
)
- const WorkerChoiceStrategyUndefinedStub = createStubInstance(
+ const workerChoiceStrategyUndefinedStub = createStubInstance(
RoundRobinWorkerChoiceStrategy,
{
choose: stub().returns(undefined)
}
)
- const WorkerChoiceStrategyNullStub = createStubInstance(
+ const workerChoiceStrategyNullStub = createStubInstance(
RoundRobinWorkerChoiceStrategy,
{
choose: stub().returns(null)
)
workerChoiceStrategyContext.workerChoiceStrategies.set(
workerChoiceStrategyContext.workerChoiceStrategy,
- WorkerChoiceStrategyUndefinedStub
+ workerChoiceStrategyUndefinedStub
)
expect(() => workerChoiceStrategyContext.execute()).toThrowError(
new Error('Worker node key chosen is null or undefined after 6 retries')
)
workerChoiceStrategyContext.workerChoiceStrategies.set(
workerChoiceStrategyContext.workerChoiceStrategy,
- WorkerChoiceStrategyNullStub
+ workerChoiceStrategyNullStub
)
expect(() => workerChoiceStrategyContext.execute()).toThrowError(
new Error('Worker node key chosen is null or undefined after 6 retries')
const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
dynamicPool
)
- const WorkerChoiceStrategyStub = createStubInstance(
+ const workerChoiceStrategyStub = createStubInstance(
RoundRobinWorkerChoiceStrategy,
{
choose: stub().returns(0)
)
workerChoiceStrategyContext.workerChoiceStrategies.set(
workerChoiceStrategyContext.workerChoiceStrategy,
- WorkerChoiceStrategyStub
+ workerChoiceStrategyStub
)
const chosenWorkerKey = workerChoiceStrategyContext.execute()
expect(