From: Jérôme Benoit Date: Fri, 14 Apr 2023 20:13:32 +0000 (+0200) Subject: test: cleanup tests description X-Git-Tag: v2.4.9~21 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=318d4156a8e078eec77d8e3fa8e8697dcc2f4d99;hp=d4aeae5aa9e260c8c2f6d28f3133de368552c108;p=poolifier.git test: cleanup tests description Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/pool.ts b/src/pools/pool.ts index 5c90ff77..f7f4e4e5 100644 --- a/src/pools/pool.ts +++ b/src/pools/pool.ts @@ -152,7 +152,7 @@ export interface IPool< */ findFreeWorkerNodeKey: () => number /** - * Performs the task specified in the constructor with the data parameter. + * Execute the function specified in the constructor with the task data parameter. * * @param data - The input for the specified task. This can only be serializable data. * @returns Promise that will be resolved when the task is successfully completed. diff --git a/tests/pools/cluster/fixed.test.js b/tests/pools/cluster/fixed.test.js index 4aaa57c7..d84c2c5c 100644 --- a/tests/pools/cluster/fixed.test.js +++ b/tests/pools/cluster/fixed.test.js @@ -72,7 +72,7 @@ describe('Fixed cluster pool test suite', () => { expect(result).toBe(false) }) - it('Verify that is possible to invoke the execute method without input', async () => { + it('Verify that is possible to invoke the execute() method without input', async () => { const result = await pool.execute() expect(result).toBe(false) }) diff --git a/tests/pools/thread/fixed.test.js b/tests/pools/thread/fixed.test.js index 6cccd6db..f2b36fa7 100644 --- a/tests/pools/thread/fixed.test.js +++ b/tests/pools/thread/fixed.test.js @@ -72,7 +72,7 @@ describe('Fixed thread pool test suite', () => { expect(result).toBe(false) }) - it('Verify that is possible to invoke the execute method without input', async () => { + it('Verify that is possible to invoke the execute() method without input', async () => { const result = await pool.execute() expect(result).toBe(false) }) diff --git a/tests/worker/abstract-worker.test.js b/tests/worker/abstract-worker.test.js index 2eae1f81..b62ba942 100644 --- a/tests/worker/abstract-worker.test.js +++ b/tests/worker/abstract-worker.test.js @@ -49,13 +49,13 @@ describe('Abstract worker test suite', () => { ) }) - it('Verify that handleError function is working properly', () => { + it('Verify that handleError() method is working properly', () => { const error = new Error('My error') const worker = new ThreadWorker(() => {}) expect(worker.handleError(error)).toStrictEqual(error) }) - it('Verify that get main worker throw error if main worker is not set', () => { + it('Verify that getMainWorker() throw error if main worker is not set', () => { expect(() => new StubPoolWithIsMainWorker(() => {}).getMainWorker() ).toThrowError('Main worker was not set') diff --git a/tests/worker/cluster-worker.test.js b/tests/worker/cluster-worker.test.js index ff749c8f..f026862d 100644 --- a/tests/worker/cluster-worker.test.js +++ b/tests/worker/cluster-worker.test.js @@ -7,7 +7,7 @@ describe('Cluster worker test suite', () => { expect(worker.opts.maxInactiveTime).toStrictEqual(60000) }) - it('Verify that handleError function works properly', () => { + it('Verify that handleError() method works properly', () => { const errorMessage = 'Error as a string' const worker = new ClusterWorker(() => {}) expect(worker.handleError(errorMessage)).toStrictEqual(errorMessage) diff --git a/tests/worker/thread-worker.test.js b/tests/worker/thread-worker.test.js index 624e395c..ff3cbff3 100644 --- a/tests/worker/thread-worker.test.js +++ b/tests/worker/thread-worker.test.js @@ -17,7 +17,7 @@ describe('Thread worker test suite', () => { expect(worker.opts.maxInactiveTime).toStrictEqual(60000) }) - it('Verify worker invoke the getMainWorker and postMessage methods', () => { + it('Verify worker invoke the getMainWorker() and postMessage() methods', () => { const worker = new SpyWorker(() => {}) worker.sendToMainWorker({ ok: 1 }) expect(numberOfMessagesPosted).toBe(1)