From 318d4156a8e078eec77d8e3fa8e8697dcc2f4d99 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 14 Apr 2023 22:13:32 +0200 Subject: [PATCH] test: cleanup tests description MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/pool.ts | 2 +- tests/pools/cluster/fixed.test.js | 2 +- tests/pools/thread/fixed.test.js | 2 +- tests/worker/abstract-worker.test.js | 4 ++-- tests/worker/cluster-worker.test.js | 2 +- tests/worker/thread-worker.test.js | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) 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) -- 2.34.1