refactor: cleanup cluster ESM issue workaround
[poolifier.git] / tests / worker / abstract-worker.test.js
index 429fff7da79d2c3d4797e645fd3d90c9d73933c9..e9da7a874de95d1739be54216ed1a540a3aff9d3 100644 (file)
@@ -193,7 +193,7 @@ describe('Abstract worker test suite', () => {
     const fn2 = () => {
       return 2
     }
-    const worker = new ThreadWorker({ fn1, fn2 })
+    const worker = new ClusterWorker({ fn1, fn2 })
     expect(worker.taskFunctions.get('default')).toBeInstanceOf(Function)
     expect(worker.taskFunctions.get('fn1')).toBeInstanceOf(Function)
     expect(worker.taskFunctions.get('fn2')).toBeInstanceOf(Function)
@@ -218,6 +218,17 @@ describe('Abstract worker test suite', () => {
     expect(worker.taskFunctions.size).toBe(2)
   })
 
+  it('Verify that listTaskFunctions() works', () => {
+    const fn1 = () => {
+      return 1
+    }
+    const fn2 = () => {
+      return 2
+    }
+    const worker = new ClusterWorker({ fn1, fn2 })
+    expect(worker.listTaskFunctions()).toStrictEqual(['default', 'fn1', 'fn2'])
+  })
+
   it('Verify that setDefaultTaskFunction() works', () => {
     const fn1 = () => {
       return 1