cleaning for ws tests
This commit is contained in:
@@ -46,15 +46,20 @@ describe('Private Spot V1 Websocket Client', () => {
|
||||
|
||||
wsClient.connectPrivate();
|
||||
|
||||
expect(wsOpenPromise).resolves.toMatchObject({
|
||||
event: WS_OPEN_EVENT_PARTIAL,
|
||||
wsKey: WS_KEY_MAP.spotPrivate,
|
||||
});
|
||||
try {
|
||||
expect(await wsOpenPromise).toMatchObject({
|
||||
event: WS_OPEN_EVENT_PARTIAL,
|
||||
// wsKey: WS_KEY_MAP.spotPrivate,
|
||||
// also opens public conn automatically, which can confuse the test
|
||||
});
|
||||
} catch (e) {
|
||||
expect(e).toBeFalsy();
|
||||
}
|
||||
// expect(wsUpdatePromise).resolves.toMatchObject({
|
||||
// topic: 'wsTopic',
|
||||
// data: expect.any(Array),
|
||||
// });
|
||||
await Promise.all([wsOpenPromise]);
|
||||
|
||||
// await Promise.all([wsUpdatePromise]);
|
||||
// await promiseSleep(4000);
|
||||
});
|
||||
|
||||
@@ -79,13 +79,11 @@ describe('Private Spot V3 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.spotV3Private,
|
||||
});
|
||||
|
||||
try {
|
||||
await Promise.all([wsOpenPromise]);
|
||||
expect(await wsOpenPromise).toMatchObject({
|
||||
event: WS_OPEN_EVENT_PARTIAL,
|
||||
wsKey: WS_KEY_MAP.spotV3Private,
|
||||
});
|
||||
} catch (e) {
|
||||
expect(e).toBeFalsy();
|
||||
}
|
||||
|
||||
@@ -34,12 +34,14 @@ describe('Public Spot V1 Websocket Client', () => {
|
||||
it('should open a public ws connection', async () => {
|
||||
const wsOpenPromise = waitForSocketEvent(wsClient, 'open');
|
||||
|
||||
expect(wsOpenPromise).resolves.toMatchObject({
|
||||
event: WS_OPEN_EVENT_PARTIAL,
|
||||
wsKey: WS_KEY_MAP.spotPublic,
|
||||
});
|
||||
|
||||
await Promise.all([wsOpenPromise]);
|
||||
try {
|
||||
expect(await wsOpenPromise).toMatchObject({
|
||||
event: WS_OPEN_EVENT_PARTIAL,
|
||||
wsKey: WS_KEY_MAP.spotPublic,
|
||||
});
|
||||
} catch (e) {
|
||||
expect(e).toBeFalsy();
|
||||
}
|
||||
});
|
||||
|
||||
it('should subscribe to public orderbook events', async () => {
|
||||
|
||||
@@ -34,12 +34,14 @@ describe('Public Spot V3 Websocket Client', () => {
|
||||
it('should open a public ws connection', async () => {
|
||||
const wsOpenPromise = waitForSocketEvent(wsClient, 'open');
|
||||
|
||||
expect(wsOpenPromise).resolves.toMatchObject({
|
||||
event: WS_OPEN_EVENT_PARTIAL,
|
||||
wsKey: WS_KEY_MAP.spotV3Public,
|
||||
});
|
||||
|
||||
await Promise.all([wsOpenPromise]);
|
||||
try {
|
||||
expect(await wsOpenPromise).toMatchObject({
|
||||
event: WS_OPEN_EVENT_PARTIAL,
|
||||
wsKey: WS_KEY_MAP.spotV3Public,
|
||||
});
|
||||
} catch (e) {
|
||||
expect(e).toBeFalsy();
|
||||
}
|
||||
});
|
||||
|
||||
it('should subscribe to public orderbook events', async () => {
|
||||
|
||||
Reference in New Issue
Block a user