feat: add destroy event to pool API
[poolifier.git] / tests / pools / thread / dynamic.test.js
index 6e6142b715b802493928b8d5d7031ecaf1ebe76f..f85d44ff4c42c6343ac49efa9cb73441c06b9e5f 100644 (file)
@@ -59,9 +59,12 @@ describe('Dynamic thread 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', () => {