numberOfWorkers,
'./tests/worker-files/thread/testWorker.js',
{
- errorHandler: e => console.error(e)
+ errorHandler: (e) => console.error(e)
}
)
- ).toThrowError('Cannot start a pool from a worker!')
+ ).toThrowError(
+ 'Cannot start a pool from a worker with the same type as the pool'
+ )
})
it('Verify that filePath is checked', () => {
new DynamicThreadPool(0, 0, './tests/worker-files/thread/testWorker.js')
).toThrowError(
new RangeError(
- 'Cannot instantiate a dynamic pool with a pool size equal to zero'
+ 'Cannot instantiate a dynamic pool with a maximum pool size equal to zero'
)
)
})
const promises = new Set()
let poolFull = 0
let poolInfo
- pool.emitter.on(PoolEvents.full, info => {
+ pool.emitter.on(PoolEvents.full, (info) => {
++poolFull
poolInfo = info
})
)
let poolInfo
let poolReady = 0
- pool.emitter.on(PoolEvents.ready, info => {
+ pool.emitter.on(PoolEvents.ready, (info) => {
++poolReady
poolInfo = info
})
const promises = new Set()
let poolBusy = 0
let poolInfo
- pool.emitter.on(PoolEvents.busy, info => {
+ pool.emitter.on(PoolEvents.busy, (info) => {
++poolBusy
poolInfo = info
})