refactor: add PoolEvents/PoolEvent types
[poolifier.git] / tests / pools / thread / dynamic.test.js
index d8c68e90c51100886bc8fe83ebfba8ec2ef094f1..9f69860aa408e42c444434dadcaf6f6ca7e1bfe5 100644 (file)
@@ -1,5 +1,5 @@
 const { expect } = require('expect')
-const { DynamicThreadPool } = require('../../../lib/index')
+const { DynamicThreadPool, PoolEvents } = require('../../../lib/index')
 const { WorkerFunctions } = require('../../test-types')
 const TestUtils = require('../../test-utils')
 
@@ -28,7 +28,7 @@ describe('Dynamic thread pool test suite', () => {
 
   it('Verify that new workers are created when required, max size is not exceeded and that after a while new workers will die', async () => {
     let poolBusy = 0
-    pool.emitter.on('busy', () => ++poolBusy)
+    pool.emitter.on(PoolEvents.busy, () => ++poolBusy)
     for (let i = 0; i < max * 2; i++) {
       pool.execute()
     }