test: fix test after async worker options deprecation
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 24 May 2023 17:34:18 +0000 (19:34 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 24 May 2023 17:34:18 +0000 (19:34 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/worker/abstract-worker.ts
tests/worker/abstract-worker.test.js

index a7060770be39e70a73a9a8327d9d4f99bc1582c5..5d0c9492204e0361b8007ef4dccfb3c0154bebca 100644 (file)
@@ -87,6 +87,7 @@ export abstract class AbstractWorker<
     this.opts.killBehavior = opts.killBehavior ?? DEFAULT_KILL_BEHAVIOR
     this.opts.maxInactiveTime =
       opts.maxInactiveTime ?? DEFAULT_MAX_INACTIVE_TIME
+    delete this.opts.async
   }
 
   /**
index 260e5b882310814b37a3cbd25c985939406a897a..02042620ea0a0bd4f57d41912de49e79829c37bf 100644 (file)
@@ -13,7 +13,7 @@ describe('Abstract worker test suite', () => {
     const worker = new ThreadWorker(() => {})
     expect(worker.opts.maxInactiveTime).toStrictEqual(60000)
     expect(worker.opts.killBehavior).toBe(KillBehaviors.SOFT)
-    expect(worker.opts.async).toBe(false)
+    expect(worker.opts.async).toBe(undefined)
   })
 
   it('Verify that worker options are set at worker creation', () => {
@@ -24,7 +24,7 @@ describe('Abstract worker test suite', () => {
     })
     expect(worker.opts.maxInactiveTime).toStrictEqual(6000)
     expect(worker.opts.killBehavior).toBe(KillBehaviors.HARD)
-    expect(worker.opts.async).toBe(true)
+    expect(worker.opts.async).toBe(undefined)
   })
 
   it('Verify that taskFunctions parameter is mandatory', () => {