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