Reset all internal statistics at worker choice strategy change
[poolifier.git] / tests / pools / abstract / abstract-pool.test.js
index 54b32ec07a9f64d8afbbc4cfb284dea925d99d81..96dc9a10ad4120a97455cd11d43e9bae38790c3c 100644 (file)
@@ -4,22 +4,23 @@ const {
   FixedThreadPool,
   WorkerChoiceStrategies
 } = require('../../../lib/index')
-const numberOfWorkers = 1
-const workerNotFoundInTasksUsageMapError = new Error(
-  'Worker could not be found in worker tasks usage map'
-)
-class StubPoolWithWorkerTasksUsageMapClear extends FixedThreadPool {
-  removeAllWorker () {
-    this.workersTasksUsage.clear()
+
+describe('Abstract pool test suite', () => {
+  const numberOfWorkers = 1
+  const workerNotFoundInTasksUsageMapError = new Error(
+    'Worker could not be found in worker tasks usage map'
+  )
+  class StubPoolWithWorkerTasksUsageMapClear extends FixedThreadPool {
+    removeAllWorker () {
+      this.workersTasksUsage.clear()
+    }
   }
-}
-class StubPoolWithIsMainMethod extends FixedThreadPool {
-  isMain () {
-    return false
+  class StubPoolWithIsMainMethod extends FixedThreadPool {
+    isMain () {
+      return false
+    }
   }
-}
 
-describe('Abstract pool test suite', () => {
   it('Simulate pool creation from a non main thread/process', () => {
     expect(
       () =>