docs: refine code comments
[poolifier.git] / tests / pools / utils.test.mjs
index 5feb6596296914252a94231e5de19132968a832f..adff47d9ba9781687a9fb89daa31dea7841fa8ca 100644 (file)
@@ -7,11 +7,23 @@ import {
 } from '../../lib/circular-array.js'
 import {
   createWorker,
+  getDefaultTasksQueueOptions,
   updateMeasurementStatistics
 } from '../../lib/pools/utils.js'
 import { WorkerTypes } from '../../lib/index.js'
 
 describe('Pool utils test suite', () => {
+  it('Verify getDefaultTasksQueueOptions() behavior', () => {
+    const poolMaxSize = 4
+    expect(getDefaultTasksQueueOptions(poolMaxSize)).toStrictEqual({
+      concurrency: 1,
+      size: Math.pow(poolMaxSize, 2),
+      taskStealing: true,
+      tasksStealingOnBackPressure: true,
+      tasksFinishedTimeout: 2000
+    })
+  })
+
   it('Verify updateMeasurementStatistics() behavior', () => {
     const measurementStatistics = {
       history: new CircularArray()