From 2285a040e7d48457c735547e296939b0341d29fd Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 7 Apr 2023 13:46:58 +0200 Subject: [PATCH] test: ensure the worker choice context class is properly initialized MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../worker-choice-strategy-context.test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/pools/selection-strategies/worker-choice-strategy-context.test.js b/tests/pools/selection-strategies/worker-choice-strategy-context.test.js index 2c0250ef..a8f187ee 100644 --- a/tests/pools/selection-strategies/worker-choice-strategy-context.test.js +++ b/tests/pools/selection-strategies/worker-choice-strategy-context.test.js @@ -50,6 +50,15 @@ describe('Worker choice strategy context test suite', () => { await dynamicPool.destroy() }) + it('Verify that constructor() initializes the context with all the available worker choice strategies', () => { + const workerChoiceStrategyContext = new WorkerChoiceStrategyContext( + fixedPool + ) + expect(workerChoiceStrategyContext.workerChoiceStrategies.size).toBe( + Object.keys(WorkerChoiceStrategies).length + ) + }) + it('Verify that execute() return the worker chosen by the strategy with fixed pool', () => { const workerChoiceStrategyContext = new WorkerChoiceStrategyContext( fixedPool -- 2.34.1