From: Jérôme Benoit Date: Fri, 15 Mar 2024 20:01:59 +0000 (+0100) Subject: refactor: use PoolEvents enum X-Git-Tag: v3.1.23~24 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a621172f44c2cb0df392499f69dcbf869c269963;p=poolifier.git refactor: use PoolEvents enum Signed-off-by: Jérôme Benoit --- diff --git a/tests/pools/cluster/dynamic.test.mjs b/tests/pools/cluster/dynamic.test.mjs index 8b6301c9..09df7318 100644 --- a/tests/pools/cluster/dynamic.test.mjs +++ b/tests/pools/cluster/dynamic.test.mjs @@ -72,7 +72,10 @@ describe('Dynamic cluster pool test suite', () => { await pool.destroy() const numberOfExitEvents = await exitPromise expect(pool.started).toBe(false) - expect(pool.emitter.eventNames()).toStrictEqual(['busy', 'destroy']) + expect(pool.emitter.eventNames()).toStrictEqual([ + PoolEvents.busy, + PoolEvents.destroy + ]) expect(pool.readyEventEmitted).toBe(false) expect(pool.workerNodes.length).toBe(0) expect(numberOfExitEvents).toBe(min) diff --git a/tests/pools/cluster/fixed.test.mjs b/tests/pools/cluster/fixed.test.mjs index c36e7ce6..fa609cf3 100644 --- a/tests/pools/cluster/fixed.test.mjs +++ b/tests/pools/cluster/fixed.test.mjs @@ -270,7 +270,10 @@ describe('Fixed cluster pool test suite', () => { await pool.destroy() const numberOfExitEvents = await exitPromise expect(pool.started).toBe(false) - expect(pool.emitter.eventNames()).toStrictEqual(['busy', 'destroy']) + expect(pool.emitter.eventNames()).toStrictEqual([ + PoolEvents.busy, + PoolEvents.destroy + ]) expect(pool.readyEventEmitted).toBe(false) expect(pool.workerNodes.length).toBe(0) expect(numberOfExitEvents).toBe(numberOfWorkers) diff --git a/tests/pools/thread/dynamic.test.mjs b/tests/pools/thread/dynamic.test.mjs index 93f75af4..6f563f52 100644 --- a/tests/pools/thread/dynamic.test.mjs +++ b/tests/pools/thread/dynamic.test.mjs @@ -72,7 +72,10 @@ describe('Dynamic thread pool test suite', () => { await pool.destroy() const numberOfExitEvents = await exitPromise expect(pool.started).toBe(false) - expect(pool.emitter.eventNames()).toStrictEqual(['busy', 'destroy']) + expect(pool.emitter.eventNames()).toStrictEqual([ + PoolEvents.busy, + PoolEvents.destroy + ]) expect(pool.readyEventEmitted).toBe(false) expect(pool.workerNodes.length).toBe(0) expect(numberOfExitEvents).toBe(min) diff --git a/tests/pools/thread/fixed.test.mjs b/tests/pools/thread/fixed.test.mjs index a17b8233..3e10a92d 100644 --- a/tests/pools/thread/fixed.test.mjs +++ b/tests/pools/thread/fixed.test.mjs @@ -301,7 +301,10 @@ describe('Fixed thread pool test suite', () => { await pool.destroy() const numberOfExitEvents = await exitPromise expect(pool.started).toBe(false) - expect(pool.emitter.eventNames()).toStrictEqual(['busy', 'destroy']) + expect(pool.emitter.eventNames()).toStrictEqual([ + PoolEvents.busy, + PoolEvents.destroy + ]) expect(pool.readyEventEmitted).toBe(false) expect(pool.workerNodes.length).toBe(0) expect(numberOfExitEvents).toBe(numberOfThreads)