refactor: move worker setup into worker node constructor
[poolifier.git] / tests / pools / thread / dynamic.test.mjs
index bf7f95278e861e0f1239d0ea36d0645399e56c3e..f7329710bd3c90e2264bebed7ab7aa628c0bccae 100644 (file)
@@ -37,10 +37,10 @@ describe('Dynamic thread pool test suite', () => {
     expect(poolBusy).toBe(1)
     const numberOfExitEvents = await waitWorkerEvents(pool, 'exit', max - min)
     expect(numberOfExitEvents).toBe(max - min)
+    expect(pool.workerNodes.length).toBe(min)
   })
 
   it('Verify scale thread up and down is working', async () => {
-    expect(pool.workerNodes.length).toBe(min)
     for (let i = 0; i < max * 2; i++) {
       pool.execute()
     }
@@ -76,7 +76,7 @@ describe('Dynamic thread pool test suite', () => {
 
   it('Validation of inputs test', () => {
     expect(() => new DynamicThreadPool(min)).toThrow(
-      "Cannot find the worker file 'undefined'"
+      'The worker file path must be specified'
     )
   })