perf: use worker node key instead of heavy worker reference in hot code path
[poolifier.git] / tests / pools / thread / fixed.test.js
index b2842f6e367eb7839053ce55844dc57bedf6ad12..99b867786b62d95454dc660201f14c55254094d5 100644 (file)
@@ -87,11 +87,11 @@ describe('Fixed thread pool test suite', () => {
     )
     let poolReady = 0
     pool1.emitter.on(PoolEvents.ready, () => ++poolReady)
-    await waitPoolEvents(pool1, PoolEvents.ready, 1)
+    await waitPoolEvents(pool1, 'ready', 1)
     expect(poolReady).toBe(1)
   })
 
-  it("Verify that 'busy' event is emitted", async () => {
+  it("Verify that 'busy' event is emitted", () => {
     let poolBusy = 0
     pool.emitter.on(PoolEvents.busy, () => ++poolBusy)
     for (let i = 0; i < numberOfThreads * 2; i++) {
@@ -163,6 +163,7 @@ describe('Fixed thread pool test suite', () => {
     expect(typeof inError.message === 'string').toBe(true)
     expect(inError.message).toBe('Error Message from ThreadWorker')
     expect(taskError).toStrictEqual({
+      name: 'default',
       message: new Error('Error Message from ThreadWorker'),
       data
     })
@@ -191,6 +192,7 @@ describe('Fixed thread pool test suite', () => {
     expect(typeof inError.message === 'string').toBe(true)
     expect(inError.message).toBe('Error Message from ThreadWorker:async')
     expect(taskError).toStrictEqual({
+      name: 'default',
       message: new Error('Error Message from ThreadWorker:async'),
       data
     })