private checkPoolType (): void {
if (this.type === PoolTypes.fixed && this.maximumNumberOfWorkers != null) {
throw new Error(
- 'Cannot instantiate a fixed pool with a maximum number of workers specified at initialization'
+ 'Cannot instantiate a fixed pool with a maximum number of workers defined at initialization'
)
}
}
export const checkFilePath = (filePath: string | undefined): void => {
if (filePath == null) {
- throw new TypeError('The worker file path must be specified')
+ throw new TypeError('The worker file path must be defined')
}
if (typeof filePath !== 'string') {
throw new TypeError('The worker file path must be a string')
it('Verify that filePath is checked', () => {
expect(() => new FixedThreadPool(numberOfWorkers)).toThrow(
- new TypeError('The worker file path must be specified')
+ new TypeError('The worker file path must be defined')
)
expect(() => new FixedThreadPool(numberOfWorkers, 0)).toThrow(
new TypeError('The worker file path must be a string')
)
).toThrow(
new Error(
- 'Cannot instantiate a fixed pool with a maximum number of workers specified at initialization'
+ 'Cannot instantiate a fixed pool with a maximum number of workers defined at initialization'
)
)
})
it('Validation of inputs test', () => {
expect(() => new DynamicClusterPool(min)).toThrow(
- 'The worker file path must be specified'
+ 'The worker file path must be defined'
)
})
it('Validation of inputs test', () => {
expect(() => new DynamicThreadPool(min)).toThrow(
- 'The worker file path must be specified'
+ 'The worker file path must be defined'
)
})