From d655027ba35d40bd823574f630debc7c3a860638 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 29 Jul 2023 12:34:48 +0200 Subject: [PATCH] refactor: cleanup worker method typing MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/worker/thread-worker.ts | 2 +- tests/circular-array.test.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/worker/thread-worker.ts b/src/worker/thread-worker.ts index ec5dea8e..dc628bed 100644 --- a/src/worker/thread-worker.ts +++ b/src/worker/thread-worker.ts @@ -67,7 +67,7 @@ export class ThreadWorker< } /** @inheritDoc */ - protected handleKillMessage (message: MessageValue): void { + protected handleKillMessage (message: MessageValue): void { super.handleKillMessage(message) this.port?.unref() this.port?.close() diff --git a/tests/circular-array.test.js b/tests/circular-array.test.js index d821b6cd..a8637234 100644 --- a/tests/circular-array.test.js +++ b/tests/circular-array.test.js @@ -133,6 +133,10 @@ describe('Circular array test suite', () => { expect(circularArray.size).toBe(0) expect(circularArray).toStrictEqual(new CircularArray(0)) circularArray = new CircularArray(5, 1, 2, 3, 4, 5) + circularArray.resize(1) + expect(circularArray.size).toBe(1) + expect(circularArray).toStrictEqual(new CircularArray(1, 1)) + circularArray = new CircularArray(5, 1, 2, 3, 4, 5) circularArray.resize(3) expect(circularArray.size).toBe(3) expect(circularArray).toStrictEqual(new CircularArray(3, 1, 2, 3)) -- 2.34.1