feat: add destroy event to pool API
[poolifier.git] / tests / pools / cluster / fixed.test.js
index 30dbc3631b92de7c71b52e386b8a6115e75d83c8..749cacaa4d4ade34727242e21caa1071be504b4c 100644 (file)
@@ -220,9 +220,12 @@ describe('Fixed cluster pool test suite', () => {
 
   it('Shutdown test', async () => {
     const exitPromise = waitWorkerEvents(pool, 'exit', numberOfWorkers)
+    let poolDestroy = 0
+    pool.emitter.on(PoolEvents.destroy, () => ++poolDestroy)
     await pool.destroy()
     const numberOfExitEvents = await exitPromise
     expect(numberOfExitEvents).toBe(numberOfWorkers)
+    expect(poolDestroy).toBe(1)
   })
 
   it('Verify that cluster pool options are checked', async () => {