build(deps-dev): bump @types/node
[poolifier.git] / tests / pools / selection-strategies / worker-choice-strategy-context.test.mjs
index f9b1c8d590ac39e9d8657bc9348456483808af0a..2a5f914e9d89a3bf40828f3ef198482612422a0c 100644 (file)
@@ -22,12 +22,12 @@ describe('Worker choice strategy context test suite', () => {
   before(() => {
     fixedPool = new FixedThreadPool(
       max,
-      './tests/worker-files/thread/testWorker.js'
+      './tests/worker-files/thread/testWorker.mjs'
     )
     dynamicPool = new DynamicThreadPool(
       min,
       max,
-      './tests/worker-files/thread/testWorker.js'
+      './tests/worker-files/thread/testWorker.mjs'
     )
   })
 
@@ -53,7 +53,7 @@ describe('Worker choice strategy context test suite', () => {
     const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
       fixedPool
     )
-    const WorkerChoiceStrategyStub = createStubInstance(
+    const workerChoiceStrategyStub = createStubInstance(
       RoundRobinWorkerChoiceStrategy,
       {
         choose: stub().returns(0)
@@ -64,7 +64,7 @@ describe('Worker choice strategy context test suite', () => {
     )
     workerChoiceStrategyContext.workerChoiceStrategies.set(
       workerChoiceStrategyContext.workerChoiceStrategy,
-      WorkerChoiceStrategyStub
+      workerChoiceStrategyStub
     )
     const chosenWorkerKey = workerChoiceStrategyContext.execute()
     expect(
@@ -79,13 +79,13 @@ describe('Worker choice strategy context test suite', () => {
     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)
@@ -96,16 +96,16 @@ describe('Worker choice strategy context test suite', () => {
     )
     workerChoiceStrategyContext.workerChoiceStrategies.set(
       workerChoiceStrategyContext.workerChoiceStrategy,
-      WorkerChoiceStrategyUndefinedStub
+      workerChoiceStrategyUndefinedStub
     )
-    expect(() => workerChoiceStrategyContext.execute()).toThrowError(
+    expect(() => workerChoiceStrategyContext.execute()).toThrow(
       new Error('Worker node key chosen is null or undefined after 6 retries')
     )
     workerChoiceStrategyContext.workerChoiceStrategies.set(
       workerChoiceStrategyContext.workerChoiceStrategy,
-      WorkerChoiceStrategyNullStub
+      workerChoiceStrategyNullStub
     )
-    expect(() => workerChoiceStrategyContext.execute()).toThrowError(
+    expect(() => workerChoiceStrategyContext.execute()).toThrow(
       new Error('Worker node key chosen is null or undefined after 6 retries')
     )
   })
@@ -114,7 +114,7 @@ describe('Worker choice strategy context test suite', () => {
     const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
       dynamicPool
     )
-    const WorkerChoiceStrategyStub = createStubInstance(
+    const workerChoiceStrategyStub = createStubInstance(
       RoundRobinWorkerChoiceStrategy,
       {
         choose: stub().returns(0)
@@ -125,7 +125,7 @@ describe('Worker choice strategy context test suite', () => {
     )
     workerChoiceStrategyContext.workerChoiceStrategies.set(
       workerChoiceStrategyContext.workerChoiceStrategy,
-      WorkerChoiceStrategyStub
+      workerChoiceStrategyStub
     )
     const chosenWorkerKey = workerChoiceStrategyContext.execute()
     expect(