From 9dfdc5b840fd521f10e4ab82258eb3cb913a7eee Mon Sep 17 00:00:00 2001 From: Dan Rose Date: Tue, 11 Jun 2024 13:05:44 -0500 Subject: [PATCH] Fix some TypeScript errors --- test/unit/socket-close-test.ts | 4 ++-- test/unit/socket-send-receive-test.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/unit/socket-close-test.ts b/test/unit/socket-close-test.ts index 7a90c877..d26cbf2c 100644 --- a/test/unit/socket-close-test.ts +++ b/test/unit/socket-close-test.ts @@ -112,7 +112,7 @@ for (const proto of testProtos("tcp", "ipc", "inproc")) { } this.slow(200) - let weakRef + let weakRef: undefined | WeakRef const task = async () => { let context: zmq.Context | undefined = new zmq.Context() @@ -145,7 +145,7 @@ for (const proto of testProtos("tcp", "ipc", "inproc")) { } this.slow(200) - let weakRef + let weakRef: undefined | WeakRef const task = async () => { let context: zmq.Context | undefined = new zmq.Context() diff --git a/test/unit/socket-send-receive-test.ts b/test/unit/socket-send-receive-test.ts index 8eee9c0f..a5855380 100644 --- a/test/unit/socket-send-receive-test.ts +++ b/test/unit/socket-send-receive-test.ts @@ -94,7 +94,7 @@ for (const proto of testProtos("tcp", "ipc", "inproc")) { if (process.env.SKIP_GC_TESTS) { this.skip() } - let weakRef + let weakRef: undefined | WeakRef sockA.connect(uniqAddress(proto)) const send = async (size: number) => { const msg = Buffer.alloc(size) @@ -115,7 +115,7 @@ for (const proto of testProtos("tcp", "ipc", "inproc")) { if (process.env.SKIP_GC_TESTS) { this.skip() } - let weakRef + let weakRef: undefined | WeakRef sockA.connect(uniqAddress(proto)) const send = async (size: number) => { @@ -130,7 +130,7 @@ for (const proto of testProtos("tcp", "ipc", "inproc")) { setTimeout(resolve, 5) }) assert.isDefined(weakRef) - assert.isUndefined(weakRef!.unref()) + assert.isUndefined(weakRef!.deref()) }) })