refactor: add PoolEvents/PoolEvent types
[poolifier.git] / tests / pools / cluster / dynamic.test.js
index 6dd9f506fd78b8e606ed7d3d99906a2cc64465e0..74cb5d8ff646d78c121793a665d06409ea181ce5 100644 (file)
@@ -1,5 +1,5 @@
 const { expect } = require('expect')
-const { DynamicClusterPool } = require('../../../lib/index')
+const { DynamicClusterPool, PoolEvents } = require('../../../lib/index')
 const { WorkerFunctions } = require('../../test-types')
 const TestUtils = require('../../test-utils')
 
@@ -28,7 +28,7 @@ describe('Dynamic cluster 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()
     }