test: fix empty pool test
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 6 May 2023 18:31:21 +0000 (20:31 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 6 May 2023 18:31:21 +0000 (20:31 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
tests/pools/abstract/abstract-pool.test.js

index a852bab430185b467176fae595fb1f8ddd7fe78f..038868c2d1502ce721561b23c469bd845e69a8f1 100644 (file)
@@ -12,9 +12,6 @@ const { Queue } = require('../../../lib/queue')
 
 describe('Abstract pool test suite', () => {
   const numberOfWorkers = 1
-  const workerNotFoundInPoolError = new Error(
-    'Worker could not be found in the pool worker nodes'
-  )
   class StubPoolWithRemoveAllWorker extends FixedThreadPool {
     removeAllWorker () {
       this.workerNodes = []
@@ -241,7 +238,7 @@ describe('Abstract pool test suite', () => {
     await pool.destroy()
   })
 
-  it('Simulate worker not found at getWorkerTasksUsage()', async () => {
+  it('Simulate worker not found', async () => {
     const pool = new StubPoolWithRemoveAllWorker(
       numberOfWorkers,
       './tests/worker-files/cluster/testWorker.js',
@@ -253,9 +250,6 @@ describe('Abstract pool test suite', () => {
     // Simulate worker not found.
     pool.removeAllWorker()
     expect(pool.workerNodes.length).toBe(0)
-    expect(() => pool.getWorkerTasksUsage()).toThrowError(
-      workerNotFoundInPoolError
-    )
     await pool.destroy()
   })