docs: refine code comment
[poolifier.git] / tests / worker / cluster-worker.test.mjs
index 33ddf374099ceeaea63acddd095531ae266d6667..228a969a574473c1ab78fa5e6c502baa8a1b9871 100644 (file)
@@ -1,5 +1,6 @@
 import { expect } from 'expect'
 import { restore, stub } from 'sinon'
+
 import { ClusterWorker } from '../../lib/index.cjs'
 import { DEFAULT_TASK_NAME } from '../../lib/utils.cjs'
 
@@ -8,6 +9,14 @@ describe('Cluster worker test suite', () => {
     restore()
   })
 
+  it('Verify worker properties value after initialization', () => {
+    const worker = new ClusterWorker(() => {})
+    expect(worker.isMain).toBe(true)
+    expect(worker.mainWorker).toBe(undefined)
+    expect(worker.taskFunctions).toBeInstanceOf(Map)
+    expect(worker.taskFunctions.size).toBe(2)
+  })
+
   it('Verify that sync kill handler is called when worker is killed', () => {
     const worker = new ClusterWorker(() => {}, {
       killHandler: stub().returns()