chore: generate documentation
[poolifier.git] / tests / pools / cluster / fixed.test.js
index 6daec1400dbc9dc0fdb921d6b25b53dd9d751eab..c638663f01c01ecdfde4b8c3c9b3ecaefe73539e 100644 (file)
@@ -3,7 +3,7 @@ const { FixedClusterPool, PoolEvents } = require('../../../lib')
 const { WorkerFunctions } = require('../../test-types')
 const { waitPoolEvents, waitWorkerEvents } = require('../../test-utils')
 
-describe('Fixed cluster pool test suite', async () => {
+describe('Fixed cluster pool test suite', () => {
   const numberOfWorkers = 6
   const pool = new FixedClusterPool(
     numberOfWorkers,
@@ -12,9 +12,6 @@ describe('Fixed cluster pool test suite', async () => {
       errorHandler: e => console.error(e)
     }
   )
-  let poolReady = 0
-  pool.emitter.on(PoolEvents.ready, () => ++poolReady)
-  await waitPoolEvents(pool, PoolEvents.ready, 1)
   const queuePool = new FixedClusterPool(
     numberOfWorkers,
     './tests/worker-files/cluster/testWorker.js',
@@ -81,6 +78,16 @@ describe('Fixed cluster pool test suite', async () => {
   })
 
   it("Verify that 'ready' event is emitted", async () => {
+    const pool1 = new FixedClusterPool(
+      numberOfWorkers,
+      './tests/worker-files/cluster/testWorker.js',
+      {
+        errorHandler: e => console.error(e)
+      }
+    )
+    let poolReady = 0
+    pool1.emitter.on(PoolEvents.ready, () => ++poolReady)
+    await waitPoolEvents(pool1, PoolEvents.ready, 1)
     expect(poolReady).toBe(1)
   })