Merge branch 'master' into interleaved-weighted-round-robin-worker-choice-strategy
[poolifier.git] / tests / pools / thread / fixed.test.js
index 09c53ea49a6afd86338679684d16e904fb2d4f75..aed2b3c193ffe90977fa9f853aa670f0eaff51b5 100644 (file)
@@ -139,6 +139,11 @@ describe('Fixed thread pool test suite', () => {
     expect(inError.message).toBeDefined()
     expect(typeof inError.message === 'string').toBe(true)
     expect(inError.message).toBe('Error Message from ThreadWorker')
+    expect(
+      errorPool.workerNodes.some(
+        workerNode => workerNode.tasksUsage.error === 1
+      )
+    ).toBe(true)
   })
 
   it('Verify that error handling is working properly:async', async () => {
@@ -154,6 +159,11 @@ describe('Fixed thread pool test suite', () => {
     expect(inError.message).toBeDefined()
     expect(typeof inError.message === 'string').toBe(true)
     expect(inError.message).toBe('Error Message from ThreadWorker:async')
+    expect(
+      asyncErrorPool.workerNodes.some(
+        workerNode => workerNode.tasksUsage.error === 1
+      )
+    ).toBe(true)
   })
 
   it('Verify that async function is working properly', async () => {