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()) }) })