refactor: add PoolEvents/PoolEvent types
[poolifier.git] / tests / pools / cluster / fixed.test.js
index ae899625dd9341dc4f9cfad3f40fab109587eb27..908acbfe84530f59d3facb59cfec315df7333cd1 100644 (file)
@@ -1,5 +1,5 @@
 const { expect } = require('expect')
-const { FixedClusterPool } = require('../../../lib/index')
+const { FixedClusterPool, PoolEvents } = require('../../../lib/index')
 const { WorkerFunctions } = require('../../test-types')
 const TestUtils = require('../../test-utils')
 
@@ -65,9 +65,9 @@ describe('Fixed cluster pool test suite', () => {
     expect(result).toBe(false)
   })
 
-  it('Verify that busy event is emitted', async () => {
+  it("Verify that 'busy' event is emitted", async () => {
     let poolBusy = 0
-    pool.emitter.on('busy', () => ++poolBusy)
+    pool.emitter.on(PoolEvents.busy, () => ++poolBusy)
     for (let i = 0; i < numberOfWorkers * 2; i++) {
       pool.execute()
     }