X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fpools%2Fabstract%2Fworker-node.test.js;h=c670d5bde921d3affadaf97462088962ef08ddab;hb=297d705dc3cac3e998e4ce25f1e7ee76c3b94be6;hp=4b325f4303dbe2692cc8a0437e55180158df3a2b;hpb=5b49e86408b36f63d5076a086e2feca64a9690d0;p=poolifier.git diff --git a/tests/pools/abstract/worker-node.test.js b/tests/pools/abstract/worker-node.test.js index 4b325f43..c670d5bd 100644 --- a/tests/pools/abstract/worker-node.test.js +++ b/tests/pools/abstract/worker-node.test.js @@ -1,5 +1,5 @@ -const { MessageChannel, Worker } = require('worker_threads') -const cluster = require('cluster') +const { MessageChannel, Worker } = require('node:worker_threads') +const cluster = require('node:cluster') const { expect } = require('expect') const { WorkerNode } = require('../../../lib/pools/worker-node') const { WorkerTypes } = require('../../../lib') @@ -129,7 +129,7 @@ describe('Worker node test suite', () => { "Cannot get task function worker usage for task function name 'invalidTaskFunction' when task function names list is not yet defined" ) ) - threadWorkerNode.info.taskFunctions = [DEFAULT_TASK_NAME, 'fn1'] + threadWorkerNode.info.taskFunctionNames = [DEFAULT_TASK_NAME, 'fn1'] expect(() => threadWorkerNode.getTaskFunctionWorkerUsage('invalidTaskFunction') ).toThrowError( @@ -137,7 +137,7 @@ describe('Worker node test suite', () => { "Cannot get task function worker usage for task function name 'invalidTaskFunction' when task function names list has less than 3 elements" ) ) - threadWorkerNode.info.taskFunctions = [DEFAULT_TASK_NAME, 'fn1', 'fn2'] + threadWorkerNode.info.taskFunctionNames = [DEFAULT_TASK_NAME, 'fn1', 'fn2'] expect( threadWorkerNode.getTaskFunctionWorkerUsage(DEFAULT_TASK_NAME) ).toStrictEqual({