From e0799a623fb4305c850a5f94ccf25e0a4b2f9dec Mon Sep 17 00:00:00 2001 From: tiagosiebler Date: Fri, 11 Nov 2022 10:24:16 +0000 Subject: [PATCH] force close test websockets --- test/inverse/ws.private.test.ts | 4 ++-- test/inverse/ws.public.test.ts | 2 +- test/linear/ws.private.test.ts | 4 ++-- test/linear/ws.public.test.ts | 2 +- test/spot/ws.private.v1.test.ts | 2 +- test/spot/ws.private.v3.test.ts | 4 ++-- test/spot/ws.public.v1.test.ts | 2 +- test/spot/ws.public.v3.test.ts | 2 +- test/unified-margin/ws.private.test.ts | 2 +- test/unified-margin/ws.public.option.test.ts | 2 +- test/unified-margin/ws.public.perp.usdc.test.ts | 2 +- test/unified-margin/ws.public.perp.usdt.test.ts | 2 +- test/usdc/options/ws.private.test.ts | 4 ++-- test/usdc/options/ws.public.test.ts | 2 +- test/usdc/perpetual/ws.private.test.ts | 4 ++-- test/usdc/perpetual/ws.public.test.ts | 2 +- 16 files changed, 21 insertions(+), 21 deletions(-) diff --git a/test/inverse/ws.private.test.ts b/test/inverse/ws.private.test.ts index 83b01c3..6c6bc5c 100644 --- a/test/inverse/ws.private.test.ts +++ b/test/inverse/ws.private.test.ts @@ -40,7 +40,7 @@ describe('Private Inverse Perps Websocket Client', () => { // console.error() expect(e?.message).toStrictEqual('Unexpected server response: 401'); } - badClient.closeAll(); + badClient.closeAll(true); }); }); @@ -62,7 +62,7 @@ describe('Private Inverse Perps Websocket Client', () => { afterAll(() => { // await promiseSleep(2000); - wsClient.closeAll(); + wsClient.closeAll(true); }); it('should open a ws connection', async () => { diff --git a/test/inverse/ws.public.test.ts b/test/inverse/ws.public.test.ts index 8d02b6d..901e14f 100644 --- a/test/inverse/ws.public.test.ts +++ b/test/inverse/ws.public.test.ts @@ -24,7 +24,7 @@ describe('Public Inverse Perps Websocket Client', () => { }); afterAll(() => { - wsClient.closeAll(); + wsClient.closeAll(true); }); it('should open a public ws connection', async () => { diff --git a/test/linear/ws.private.test.ts b/test/linear/ws.private.test.ts index 09290b1..60c16fd 100644 --- a/test/linear/ws.private.test.ts +++ b/test/linear/ws.private.test.ts @@ -38,7 +38,7 @@ describe('Private Linear Perps Websocket Client', () => { } catch (e) { expect(e?.message).toStrictEqual('Unexpected server response: 401'); } - badClient.closeAll(); + badClient.closeAll(true); }); }); @@ -65,7 +65,7 @@ describe('Private Linear Perps Websocket Client', () => { }); afterAll(() => { - wsClient.closeAll(); + wsClient.closeAll(true); }); it('should open a ws connection', async () => { diff --git a/test/linear/ws.public.test.ts b/test/linear/ws.public.test.ts index a29f159..744edc1 100644 --- a/test/linear/ws.public.test.ts +++ b/test/linear/ws.public.test.ts @@ -22,7 +22,7 @@ describe('Public Linear Perps Websocket Client', () => { }); afterAll(() => { - wsClient.closeAll(); + wsClient.closeAll(true); }); it('should open a public ws connection', async () => { diff --git a/test/spot/ws.private.v1.test.ts b/test/spot/ws.private.v1.test.ts index 7361a36..5a98082 100644 --- a/test/spot/ws.private.v1.test.ts +++ b/test/spot/ws.private.v1.test.ts @@ -36,7 +36,7 @@ describe('Private Spot V1 Websocket Client', () => { }); afterAll(() => { - wsClient.closeAll(); + wsClient.closeAll(true); }); // TODO: how to detect if auth failed for the v1 spot ws diff --git a/test/spot/ws.private.v3.test.ts b/test/spot/ws.private.v3.test.ts index 6fb8442..39a3b0b 100644 --- a/test/spot/ws.private.v3.test.ts +++ b/test/spot/ws.private.v3.test.ts @@ -50,7 +50,7 @@ describe('Private Spot V3 Websocket Client', () => { } catch (e) { // console.error() } - badClient.closeAll(); + badClient.closeAll(true); }); }); @@ -72,7 +72,7 @@ describe('Private Spot V3 Websocket Client', () => { }); afterAll(() => { - wsClient.closeAll(); + wsClient.closeAll(true); }); it('should open a private ws connection', async () => { diff --git a/test/spot/ws.public.v1.test.ts b/test/spot/ws.public.v1.test.ts index 3b021b2..0e2219c 100644 --- a/test/spot/ws.public.v1.test.ts +++ b/test/spot/ws.public.v1.test.ts @@ -28,7 +28,7 @@ describe('Public Spot V1 Websocket Client', () => { }); afterAll(() => { - wsClient.closeAll(); + wsClient.closeAll(true); }); it('should open a public ws connection', async () => { diff --git a/test/spot/ws.public.v3.test.ts b/test/spot/ws.public.v3.test.ts index 0f2d662..43377cc 100644 --- a/test/spot/ws.public.v3.test.ts +++ b/test/spot/ws.public.v3.test.ts @@ -28,7 +28,7 @@ describe('Public Spot V3 Websocket Client', () => { }); afterAll(() => { - wsClient.closeAll(); + wsClient.closeAll(true); }); it('should open a public ws connection', async () => { diff --git a/test/unified-margin/ws.private.test.ts b/test/unified-margin/ws.private.test.ts index 72c16a1..313321d 100644 --- a/test/unified-margin/ws.private.test.ts +++ b/test/unified-margin/ws.private.test.ts @@ -29,7 +29,7 @@ describe('Private Unified Margin Websocket Client', () => { }); afterAll(() => { - wsClient.closeAll(); + wsClient.closeAll(true); }); it('should open a public ws connection', async () => { diff --git a/test/unified-margin/ws.public.option.test.ts b/test/unified-margin/ws.public.option.test.ts index cd05b9b..0870511 100644 --- a/test/unified-margin/ws.public.option.test.ts +++ b/test/unified-margin/ws.public.option.test.ts @@ -26,7 +26,7 @@ describe('Public Unified Margin Websocket Client (Options)', () => { }); afterAll(() => { - wsClient.closeAll(); + wsClient.closeAll(true); }); it('should open a public ws connection', async () => { diff --git a/test/unified-margin/ws.public.perp.usdc.test.ts b/test/unified-margin/ws.public.perp.usdc.test.ts index 1b526a3..cb1a31f 100644 --- a/test/unified-margin/ws.public.perp.usdc.test.ts +++ b/test/unified-margin/ws.public.perp.usdc.test.ts @@ -29,7 +29,7 @@ describe('Public Unified Margin Websocket Client (Perps - USDC)', () => { }); afterAll(() => { - wsClient.closeAll(); + wsClient.closeAll(true); }); it('should open a public ws connection', async () => { diff --git a/test/unified-margin/ws.public.perp.usdt.test.ts b/test/unified-margin/ws.public.perp.usdt.test.ts index 800c961..6880524 100644 --- a/test/unified-margin/ws.public.perp.usdt.test.ts +++ b/test/unified-margin/ws.public.perp.usdt.test.ts @@ -29,7 +29,7 @@ describe('Public Unified Margin Websocket Client (Perps - USDT)', () => { }); afterAll(() => { - wsClient.closeAll(); + wsClient.closeAll(true); }); it('should open a public ws connection', async () => { diff --git a/test/usdc/options/ws.private.test.ts b/test/usdc/options/ws.private.test.ts index ae93be4..b6f52d4 100644 --- a/test/usdc/options/ws.private.test.ts +++ b/test/usdc/options/ws.private.test.ts @@ -60,7 +60,7 @@ describe('Private USDC Option Websocket Client', () => { // badClient.subscribe(wsTopic); badClient.removeAllListeners(); - badClient.closeAll(); + badClient.closeAll(true); }); }); @@ -81,7 +81,7 @@ describe('Private USDC Option Websocket Client', () => { }); afterAll(() => { - wsClient.closeAll(); + wsClient.closeAll(true); }); it('should open a private ws connection', async () => { diff --git a/test/usdc/options/ws.public.test.ts b/test/usdc/options/ws.public.test.ts index 90b4822..63d6ef9 100644 --- a/test/usdc/options/ws.public.test.ts +++ b/test/usdc/options/ws.public.test.ts @@ -26,7 +26,7 @@ describe('Public USDC Option Websocket Client', () => { }); afterAll(() => { - wsClient.closeAll(); + wsClient.closeAll(true); }); it('should open a public ws connection', async () => { diff --git a/test/usdc/perpetual/ws.private.test.ts b/test/usdc/perpetual/ws.private.test.ts index 7508292..5c2e302 100644 --- a/test/usdc/perpetual/ws.private.test.ts +++ b/test/usdc/perpetual/ws.private.test.ts @@ -60,7 +60,7 @@ describe('Private USDC Perp Websocket Client', () => { // badClient.subscribe(wsTopic); badClient.removeAllListeners(); - badClient.closeAll(); + badClient.closeAll(true); }); }); @@ -82,7 +82,7 @@ describe('Private USDC Perp Websocket Client', () => { }); afterAll(() => { - wsClient.closeAll(); + wsClient.closeAll(true); }); it('should open a private ws connection', async () => { diff --git a/test/usdc/perpetual/ws.public.test.ts b/test/usdc/perpetual/ws.public.test.ts index d5bcb87..c858f07 100644 --- a/test/usdc/perpetual/ws.public.test.ts +++ b/test/usdc/perpetual/ws.public.test.ts @@ -27,7 +27,7 @@ describe('Public USDC Perp Websocket Client', () => { }); afterAll(() => { - wsClient.closeAll(); + wsClient.closeAll(true); }); it('should open a public ws connection', async () => {