From: Jérôme Benoit Date: Wed, 24 May 2023 17:34:18 +0000 (+0200) Subject: test: fix test after async worker options deprecation X-Git-Tag: v2.5.0~25 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=571227f458c744641b0d3f5cfe9d22ed19640e62;p=poolifier.git test: fix test after async worker options deprecation Signed-off-by: Jérôme Benoit --- diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index a7060770..5d0c9492 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -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 } /** diff --git a/tests/worker/abstract-worker.test.js b/tests/worker/abstract-worker.test.js index 260e5b88..02042620 100644 --- a/tests/worker/abstract-worker.test.js +++ b/tests/worker/abstract-worker.test.js @@ -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', () => {