fix: test for worker file existence
[poolifier.git] / tests / pools / abstract / abstract-pool.test.js
index 05e4c34ea094023d61db4f0584c022af645e8c5e..c4fd6c65bcac7dac4b7e65a445b0600b354ee787 100644 (file)
@@ -5,8 +5,8 @@ const {
   FixedClusterPool,
   FixedThreadPool,
   PoolEvents,
-  WorkerChoiceStrategies,
   PoolTypes,
+  WorkerChoiceStrategies,
   WorkerTypes
 } = require('../../../lib')
 const { CircularArray } = require('../../../lib/circular-array')
@@ -45,6 +45,15 @@ describe('Abstract pool test suite', () => {
     expect(() => new FixedThreadPool(numberOfWorkers, '')).toThrowError(
       expectedError
     )
+    expect(() => new FixedThreadPool(numberOfWorkers, 0)).toThrowError(
+      expectedError
+    )
+    expect(() => new FixedThreadPool(numberOfWorkers, true)).toThrowError(
+      expectedError
+    )
+    expect(
+      () => new FixedThreadPool(numberOfWorkers, './dummyWorker.ts')
+    ).toThrowError(new Error("Cannot find the worker file './dummyWorker.ts'"))
   })
 
   it('Verify that numberOfWorkers is checked', () => {