From 571227f458c744641b0d3f5cfe9d22ed19640e62 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 24 May 2023 19:34:18 +0200 Subject: [PATCH] test: fix test after async worker options deprecation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/worker/abstract-worker.ts | 1 + tests/worker/abstract-worker.test.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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', () => { -- 2.34.1