const { expect } = require('expect')
-const { FixedThreadPool } = require('../../../lib/index')
+const { FixedThreadPool, PoolEvents } = require('../../../lib/index')
const { WorkerFunctions } = require('../../test-types')
const TestUtils = require('../../test-utils')
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 < numberOfThreads * 2; i++) {
pool.execute()
}