From b7d085c432048df7f7d9fd555f7ada41d5078405 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 3 Sep 2023 14:39:42 +0200 Subject: [PATCH] test: fix UTs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/abstract-pool.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 0b56cbe4..ab7fcf51 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -297,37 +297,37 @@ export abstract class AbstractPool< throw new TypeError('Invalid tasks queue options: must be a plain object') } if ( - tasksQueueOptions.concurrency != null && - !Number.isSafeInteger(tasksQueueOptions.concurrency) + tasksQueueOptions?.concurrency != null && + !Number.isSafeInteger(tasksQueueOptions?.concurrency) ) { throw new TypeError( 'Invalid worker node tasks concurrency: must be an integer' ) } if ( - tasksQueueOptions.concurrency != null && - tasksQueueOptions.concurrency <= 0 + tasksQueueOptions?.concurrency != null && + tasksQueueOptions?.concurrency <= 0 ) { throw new RangeError( - `Invalid worker node tasks concurrency: ${tasksQueueOptions.concurrency} is a negative integer or zero` + `Invalid worker node tasks concurrency: ${tasksQueueOptions?.concurrency} is a negative integer or zero` ) } - if (tasksQueueOptions.queueMaxSize != null) { + if (tasksQueueOptions?.queueMaxSize != null) { throw new Error( 'Invalid tasks queue options: queueMaxSize is deprecated, please use size instead' ) } if ( - tasksQueueOptions.size != null && - !Number.isSafeInteger(tasksQueueOptions.size) + tasksQueueOptions?.size != null && + !Number.isSafeInteger(tasksQueueOptions?.size) ) { throw new TypeError( 'Invalid worker node tasks queue size: must be an integer' ) } - if (tasksQueueOptions.size != null && tasksQueueOptions.size <= 0) { + if (tasksQueueOptions?.size != null && tasksQueueOptions?.size <= 0) { throw new RangeError( - `Invalid worker node tasks queue size: ${tasksQueueOptions.size} is a negative integer or zero` + `Invalid worker node tasks queue size: ${tasksQueueOptions?.size} is a negative integer or zero` ) } } -- 2.34.1