+ await pool.destroy()
+ })
+
+ it('Verify destroyWorkerNode()', async () => {
+ const workerFilePath = './tests/worker-files/cluster/testWorker.js'
+ const pool = new FixedClusterPool(numberOfWorkers, workerFilePath)
+ const workerNodeKey = 0
+ let disconnectEvent = 0
+ pool.workerNodes[workerNodeKey].worker.on('disconnect', () => {
+ ++disconnectEvent
+ })
+ let exitEvent = 0
+ pool.workerNodes[workerNodeKey].worker.on('exit', () => {
+ ++exitEvent
+ })
+ await expect(pool.destroyWorkerNode(workerNodeKey)).resolves.toBeUndefined()
+ expect(disconnectEvent).toBe(1)
+ expect(exitEvent).toBe(1)
+ expect(pool.workerNodes.length).toBe(numberOfWorkers - 1)
+ await pool.destroy()