cleaning for ws tests

This commit is contained in:
tiagosiebler
2022-09-16 15:09:39 +01:00
parent f4a569dcba
commit 1c3707b6d2
12 changed files with 90 additions and 93 deletions

View File

@@ -89,13 +89,11 @@ describe('Private USDC Perp Websocket Client', () => {
const wsOpenPromise = waitForSocketEvent(wsClient, 'open');
const wsResponsePromise = waitForSocketEvent(wsClient, 'response');
expect(wsOpenPromise).resolves.toMatchObject({
event: WS_OPEN_EVENT_PARTIAL,
wsKey: WS_KEY_MAP.usdcPerpPrivate,
});
try {
await Promise.all([wsOpenPromise]);
expect(await wsOpenPromise).toMatchObject({
event: WS_OPEN_EVENT_PARTIAL,
wsKey: WS_KEY_MAP.usdcPerpPrivate,
});
} catch (e) {
expect(e).toBeFalsy();
}

View File

@@ -33,12 +33,10 @@ describe('Public USDC Perp Websocket Client', () => {
it('should open a public ws connection', async () => {
const wsOpenPromise = waitForSocketEvent(wsClient, 'open');
expect(wsOpenPromise).resolves.toMatchObject({
expect(await wsOpenPromise).toMatchObject({
event: WS_OPEN_EVENT_PARTIAL,
wsKey: WS_KEY_MAP.usdcPerpPublic,
});
await Promise.all([wsOpenPromise]);
});
it('should subscribe to public trade events', async () => {