}
)
).toThrowError(
- 'Cannot start a pool from a worker with the same type as the pool'
+ new Error(
+ 'Cannot start a pool from a worker with the same type as the pool'
+ )
)
})
it('Verify that numberOfWorkers is checked', () => {
expect(() => new FixedThreadPool()).toThrowError(
- 'Cannot instantiate a pool without specifying the number of workers'
+ new Error(
+ 'Cannot instantiate a pool without specifying the number of workers'
+ )
)
})
}
)
).toThrowError(
- new TypeError(
+ new RangeError(
'Invalid worker tasks concurrency: 0 is a negative integer or zero'
)
)
new TypeError('Invalid tasks queue options: must be a plain object')
)
expect(() => pool.setTasksQueueOptions({ concurrency: 0 })).toThrowError(
- new Error(
+ new RangeError(
'Invalid worker tasks concurrency: 0 is a negative integer or zero'
)
)
expect(() => pool.setTasksQueueOptions({ concurrency: -1 })).toThrowError(
- new Error(
+ new RangeError(
'Invalid worker tasks concurrency: -1 is a negative integer or zero'
)
)