Bump to beta 7 version
[poolifier.git] / tests / pools / abstract / abstract-pool.test.js
index d5d87058ed2c7f1f2f24c9a18347f00199f146f3..9b32a7e09fb6d8d9ff9b90de389b9c41d3178ce1 100644 (file)
@@ -14,16 +14,16 @@ class StubPoolWithIsMainMethod extends FixedThreadPool {
   }
 }
 
-describe('Abstract pool test suite ', () => {
+describe('Abstract pool test suite', () => {
   it('Simulate worker not found during increaseWorkersTask', () => {
     const pool = new StubPoolWithTasksMapClear(
       1,
-      './tests/worker/cluster/testWorker.js',
+      './tests/worker-files/cluster/testWorker.js',
       {
         errorHandler: e => console.error(e)
       }
     )
-    // simulate worker not found.
+    // Simulate worker not found.
     pool.removeAllWorker()
     expect(() => pool.increaseWorkersTask()).toThrowError(expectedError)
   })
@@ -31,12 +31,12 @@ describe('Abstract pool test suite ', () => {
   it('Simulate worker not found during decreaseWorkersTasks', () => {
     const pool = new StubPoolWithTasksMapClear(
       1,
-      './tests/worker/cluster/testWorker.js',
+      './tests/worker-files/cluster/testWorker.js',
       {
         errorHandler: e => console.error(e)
       }
     )
-    // simulate worker not found.
+    // Simulate worker not found.
     pool.removeAllWorker()
     expect(() => pool.decreaseWorkersTasks()).toThrowError(expectedError)
   })
@@ -45,11 +45,20 @@ describe('Abstract pool test suite ', () => {
     expect(() => {
       const pool = new StubPoolWithIsMainMethod(
         1,
-        './tests/worker/cluster/testWorker.js',
+        './tests/worker-files/cluster/testWorker.js',
         {
           errorHandler: e => console.error(e)
         }
       )
     }).toThrowError()
   })
+
+  it('Verify that filePath is checked', () => {
+    expect(() => {
+      const pool = new StubPoolWithIsMainMethod(1).toThrowError()
+    })
+    expect(() => {
+      const pool = new StubPoolWithIsMainMethod(1, '').toThrowError()
+    })
+  })
 })