X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=inline;f=tests%2Fpools%2Fworker-node.test.mjs;h=3b87a8485d39e0547707197c8667238ec35a0265;hb=de868be6cc9bcfb6d341ffb14e6407c24a1a0e17;hp=cfca3422b0f3ff727138608a65f7542dff63ba35;hpb=c3719753af0a9be03abf722a7543495359e817b5;p=poolifier.git diff --git a/tests/pools/worker-node.test.mjs b/tests/pools/worker-node.test.mjs index cfca3422..3b87a848 100644 --- a/tests/pools/worker-node.test.mjs +++ b/tests/pools/worker-node.test.mjs @@ -1,4 +1,5 @@ -import { MessageChannel } from 'node:worker_threads' +import { MessageChannel, Worker as ThreadWorker } from 'node:worker_threads' +import { Worker as ClusterWorker } from 'node:cluster' import { expect } from 'expect' import { WorkerNode } from '../../lib/pools/worker-node.js' import { WorkerTypes } from '../../lib/index.js' @@ -118,6 +119,7 @@ describe('Worker node test suite', () => { ) ) expect(threadWorkerNode).toBeInstanceOf(WorkerNode) + expect(threadWorkerNode.worker).toBeInstanceOf(ThreadWorker) expect(threadWorkerNode.info).toStrictEqual({ id: threadWorkerNode.worker.threadId, type: WorkerTypes.thread, @@ -160,6 +162,7 @@ describe('Worker node test suite', () => { expect(threadWorkerNode.taskFunctionsUsage).toBeInstanceOf(Map) expect(clusterWorkerNode).toBeInstanceOf(WorkerNode) + expect(clusterWorkerNode.worker).toBeInstanceOf(ClusterWorker) expect(clusterWorkerNode.info).toStrictEqual({ id: clusterWorkerNode.worker.id, type: WorkerTypes.cluster,