From 86a2f8d7d73aad1836f4741be4fa90e44db0e01f Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Thu, 18 Jul 2024 18:26:59 +0100 Subject: [PATCH] fix(win): close or destroy tcp socket for net.connect & net.createServer - use socket.destroy for node 16 compat on windows --- test/matt.consumer.integration.spec.ts | 1 + test/matt.provider.integration.spec.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/test/matt.consumer.integration.spec.ts b/test/matt.consumer.integration.spec.ts index fa439829..0766d7fa 100644 --- a/test/matt.consumer.integration.spec.ts +++ b/test/matt.consumer.integration.spec.ts @@ -38,6 +38,7 @@ const sendMattMessageTCP = ( return new Promise((resolve) => { socket.on('data', (data) => { resolve(parseMattMessage(data.toString())); + socket.destroy(); }); }); }; diff --git a/test/matt.provider.integration.spec.ts b/test/matt.provider.integration.spec.ts index ad0097ed..5cb7969d 100644 --- a/test/matt.provider.integration.spec.ts +++ b/test/matt.provider.integration.spec.ts @@ -40,6 +40,7 @@ const startTCPServer = (host: string, port: number) => { sock.write(generateMattMessage('message not understood')); } sock.write('\n'); + sock.destroy(); }); });