X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fworker%2Fcluster-worker.test.mjs;h=70d63639dab40d0a61622f73a8e5da18809c7ec7;hb=f48170aa0c8d2c5555b973ae2e040d04435ace47;hp=228a969a574473c1ab78fa5e6c502baa8a1b9871;hpb=394676d15b59b7013b9d95889e47a4a49860b057;p=poolifier.git diff --git a/tests/worker/cluster-worker.test.mjs b/tests/worker/cluster-worker.test.mjs index 228a969a..70d63639 100644 --- a/tests/worker/cluster-worker.test.mjs +++ b/tests/worker/cluster-worker.test.mjs @@ -52,9 +52,15 @@ describe('Cluster worker test suite', () => { status: false, error: new TypeError('name parameter is an empty string') }) - expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toBeInstanceOf(Function) - expect(worker.taskFunctions.get('fn1')).toBeInstanceOf(Function) - expect(worker.taskFunctions.get('fn2')).toBeInstanceOf(Function) + expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({ + taskFunction: expect.any(Function) + }) + expect(worker.taskFunctions.get('fn1')).toStrictEqual({ + taskFunction: expect.any(Function) + }) + expect(worker.taskFunctions.get('fn2')).toStrictEqual({ + taskFunction: expect.any(Function) + }) expect(worker.taskFunctions.size).toBe(3) expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual( worker.taskFunctions.get('fn1') @@ -72,8 +78,12 @@ describe('Cluster worker test suite', () => { ) }) worker.removeTaskFunction('fn2') - expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toBeInstanceOf(Function) - expect(worker.taskFunctions.get('fn1')).toBeInstanceOf(Function) + expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({ + taskFunction: expect.any(Function) + }) + expect(worker.taskFunctions.get('fn1')).toStrictEqual({ + taskFunction: expect.any(Function) + }) expect(worker.taskFunctions.get('fn2')).toBeUndefined() expect(worker.taskFunctions.size).toBe(2) expect(worker.getMainWorker.calledTwice).toBe(true)