refactor: use PoolEvents enum
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 15 Mar 2024 20:01:59 +0000 (21:01 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 15 Mar 2024 20:01:59 +0000 (21:01 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
tests/pools/cluster/dynamic.test.mjs
tests/pools/cluster/fixed.test.mjs
tests/pools/thread/dynamic.test.mjs
tests/pools/thread/fixed.test.mjs

index 8b6301c932aaea4f05972e12085c1509deec93d7..09df7318b44bfb1895331904bc9848f1cddb07ad 100644 (file)
@@ -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)
index c36e7ce6b3b2fd9f73b45707774a985fa439a77f..fa609cf357a8ac6763f2848c2102a5a47ffd6a0c 100644 (file)
@@ -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)
index 93f75af4247bb0c895869080bf250fc447c3ec52..6f563f520989246cdd17198518e178dec1052384 100644 (file)
@@ -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)
index a17b8233697f5cd6836296eb93891b83f80f5da4..3e10a92d0be8156f4dfd22289a0d3197a532fb1b 100644 (file)
@@ -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)