feat: add destroy event to pool API
[poolifier.git] / tests / pools / cluster / dynamic.test.js
index 724c0c91348b974cd3b0696c9457640c93978c3e..c91447ee31b6fe1f23c048b9d25568f0bfd8d0db 100644 (file)
@@ -59,9 +59,12 @@ describe('Dynamic cluster pool test suite', () => {
 
   it('Shutdown test', async () => {
     const exitPromise = waitWorkerEvents(pool, 'exit', min)
+    let poolDestroy = 0
+    pool.emitter.on(PoolEvents.destroy, () => ++poolDestroy)
     await pool.destroy()
     const numberOfExitEvents = await exitPromise
     expect(numberOfExitEvents).toBe(min)
+    expect(poolDestroy).toBe(1)
   })
 
   it('Validation of inputs test', () => {