From 16248b233364112df0972c0e9154941f561f09cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 18 Sep 2023 22:18:54 +0200 Subject: [PATCH] docs: refine changelog entry MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- CHANGELOG.md | 2 +- src/pools/abstract-pool.ts | 2 +- src/utility-types.ts | 2 +- tests/pools/abstract/abstract-pool.test.js | 4 +--- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f5bda97..b6ba6fba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Add `addTaskFunction()`, `removeTaskFunction()`, `setDefaultTaskFunction()` methods to pool API. +- Add `hasTaskFunction()`, `addTaskFunction()`, `removeTaskFunction()`, `setDefaultTaskFunction()` methods to pool API. - Stricter worker constructor arguments validation. ## [2.6.45] - 2023-09-17 diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 7be2cef5..779d2b59 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -860,7 +860,7 @@ export abstract class AbstractPool< public async removeTaskFunction (name: string): Promise { if (!this.taskFunctions.has(name)) { throw new Error( - 'Cannot remove a task function that does not exist on the pool side' + 'Cannot remove a task function not handled on the pool side' ) } this.taskFunctions.delete(name) diff --git a/src/utility-types.ts b/src/utility-types.ts index 3817515a..48988c08 100644 --- a/src/utility-types.ts +++ b/src/utility-types.ts @@ -119,7 +119,7 @@ export interface MessageValue /** * Task function operation: * - `'add'` - Add a task function. - * - `'delete'` - Delete a task function. + * - `'remove'` - Remove a task function. * - `'default'` - Set a task function as default. */ readonly taskFunctionOperation?: 'add' | 'remove' | 'default' diff --git a/tests/pools/abstract/abstract-pool.test.js b/tests/pools/abstract/abstract-pool.test.js index 5c27a4b6..e9cca732 100644 --- a/tests/pools/abstract/abstract-pool.test.js +++ b/tests/pools/abstract/abstract-pool.test.js @@ -1319,9 +1319,7 @@ describe('Abstract pool test suite', () => { await expect( dynamicThreadPool.removeTaskFunction('test') ).rejects.toThrowError( - new Error( - 'Cannot remove a task function that does not exist on the pool side' - ) + new Error('Cannot remove a task function not handled on the pool side') ) const echoTaskFunction = data => { return data -- 2.34.1