test: cover new pool methods
[poolifier.git] / src / pools / abstract-pool.ts
index 3d10391c17748cdd63473c4afae7630665023008..7be2cef51c8f11646b5f43174de7abe3ea43a82c 100644 (file)
@@ -858,6 +858,11 @@ export abstract class AbstractPool<
 
   /** @inheritDoc */
   public async removeTaskFunction (name: string): Promise<boolean> {
+    if (!this.taskFunctions.has(name)) {
+      throw new Error(
+        'Cannot remove a task function that does not exist on the pool side'
+      )
+    }
     this.taskFunctions.delete(name)
     return await this.sendTaskFunctionOperationToWorkers({
       taskFunctionOperation: 'remove',