slight logger improvement for test
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
WS_KEY_MAP,
|
||||
} from '../../src';
|
||||
import {
|
||||
silentLogger,
|
||||
getSilentLogger,
|
||||
waitForSocketEvent,
|
||||
WS_OPEN_EVENT_PARTIAL,
|
||||
} from '../ws.util';
|
||||
@@ -27,7 +27,7 @@ describe('Private Inverse Perps Websocket Client', () => {
|
||||
key: 'bad',
|
||||
secret: 'bad',
|
||||
},
|
||||
silentLogger
|
||||
getSilentLogger('expect401')
|
||||
);
|
||||
|
||||
const wsOpenPromise = waitForSocketEvent(badClient, 'open', 2500);
|
||||
@@ -53,7 +53,10 @@ describe('Private Inverse Perps Websocket Client', () => {
|
||||
});
|
||||
|
||||
beforeAll(() => {
|
||||
wsClient = new WebsocketClient(wsClientOptions, silentLogger);
|
||||
wsClient = new WebsocketClient(
|
||||
wsClientOptions,
|
||||
getSilentLogger('expectSuccess')
|
||||
);
|
||||
wsClient.connectPrivate();
|
||||
});
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
WS_KEY_MAP,
|
||||
} from '../../src';
|
||||
import {
|
||||
silentLogger,
|
||||
getSilentLogger,
|
||||
waitForSocketEvent,
|
||||
WS_OPEN_EVENT_PARTIAL,
|
||||
} from '../ws.util';
|
||||
@@ -27,7 +27,7 @@ describe('Private Linear Perps Websocket Client', () => {
|
||||
key: 'bad',
|
||||
secret: 'bad',
|
||||
},
|
||||
silentLogger
|
||||
getSilentLogger('expect401')
|
||||
);
|
||||
|
||||
const wsOpenPromise = waitForSocketEvent(badClient, 'open', 2500);
|
||||
@@ -58,7 +58,10 @@ describe('Private Linear Perps Websocket Client', () => {
|
||||
};
|
||||
|
||||
beforeAll(() => {
|
||||
wsClient = new WebsocketClient(wsClientOptions, silentLogger);
|
||||
wsClient = new WebsocketClient(
|
||||
wsClientOptions,
|
||||
getSilentLogger('expectSuccess')
|
||||
);
|
||||
wsClient.connectPrivate();
|
||||
});
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
import {
|
||||
logAllEvents,
|
||||
promiseSleep,
|
||||
silentLogger,
|
||||
getSilentLogger,
|
||||
waitForSocketEvent,
|
||||
WS_OPEN_EVENT_PARTIAL,
|
||||
} from '../ws.util';
|
||||
@@ -28,7 +28,10 @@ describe('Private Spot V1 Websocket Client', () => {
|
||||
};
|
||||
|
||||
beforeAll(() => {
|
||||
wsClient = new WebsocketClient(wsClientOptions, silentLogger);
|
||||
wsClient = new WebsocketClient(
|
||||
wsClientOptions,
|
||||
getSilentLogger('expectSuccess')
|
||||
);
|
||||
logAllEvents(wsClient);
|
||||
});
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
WS_KEY_MAP,
|
||||
} from '../../src';
|
||||
import {
|
||||
silentLogger,
|
||||
getSilentLogger,
|
||||
waitForSocketEvent,
|
||||
WS_OPEN_EVENT_PARTIAL,
|
||||
} from '../ws.util';
|
||||
@@ -29,7 +29,7 @@ describe('Private Spot V3 Websocket Client', () => {
|
||||
key: 'bad',
|
||||
secret: 'bad',
|
||||
},
|
||||
silentLogger
|
||||
getSilentLogger('expect401')
|
||||
);
|
||||
|
||||
// const wsOpenPromise = waitForSocketEvent(badClient, 'open');
|
||||
@@ -63,7 +63,10 @@ describe('Private Spot V3 Websocket Client', () => {
|
||||
});
|
||||
|
||||
beforeAll(() => {
|
||||
wsClient = new WebsocketClient(wsClientOptions, silentLogger);
|
||||
wsClient = new WebsocketClient(
|
||||
wsClientOptions,
|
||||
getSilentLogger('expectSuccess')
|
||||
);
|
||||
wsClient.connectPrivate();
|
||||
// logAllEvents(wsClient);
|
||||
});
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
} from '../../src';
|
||||
import {
|
||||
logAllEvents,
|
||||
silentLogger,
|
||||
getSilentLogger,
|
||||
fullLogger,
|
||||
waitForSocketEvent,
|
||||
WS_OPEN_EVENT_PARTIAL,
|
||||
@@ -19,7 +19,10 @@ describe('Public Spot V1 Websocket Client', () => {
|
||||
};
|
||||
|
||||
beforeAll(() => {
|
||||
wsClient = new WebsocketClient(wsClientOptions, silentLogger);
|
||||
wsClient = new WebsocketClient(
|
||||
wsClientOptions,
|
||||
getSilentLogger('expectSuccess')
|
||||
);
|
||||
wsClient.connectPublic();
|
||||
// logAllEvents(wsClient);
|
||||
});
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
} from '../../src';
|
||||
import {
|
||||
logAllEvents,
|
||||
silentLogger,
|
||||
getSilentLogger,
|
||||
fullLogger,
|
||||
waitForSocketEvent,
|
||||
WS_OPEN_EVENT_PARTIAL,
|
||||
@@ -19,7 +19,10 @@ describe('Public Spot V3 Websocket Client', () => {
|
||||
};
|
||||
|
||||
beforeAll(() => {
|
||||
wsClient = new WebsocketClient(wsClientOptions, silentLogger);
|
||||
wsClient = new WebsocketClient(
|
||||
wsClientOptions,
|
||||
getSilentLogger('expectSuccess')
|
||||
);
|
||||
wsClient.connectPublic();
|
||||
// logAllEvents(wsClient);
|
||||
});
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import { WebsocketClient, WsClientEvent } from '../src';
|
||||
|
||||
export const silentLogger = {
|
||||
silly: () => {},
|
||||
debug: () => {},
|
||||
notice: () => {},
|
||||
info: () => {},
|
||||
warning: (...params) => console.warn('warning', ...params),
|
||||
error: (...params) => console.error('error', ...params),
|
||||
};
|
||||
export function getSilentLogger(logHint?: string) {
|
||||
return {
|
||||
silly: () => {},
|
||||
debug: () => {},
|
||||
notice: () => {},
|
||||
info: () => {},
|
||||
warning: (...params) => console.warn('warning', logHint, ...params),
|
||||
error: (...params) => console.error('error', logHint, ...params),
|
||||
};
|
||||
}
|
||||
|
||||
export const fullLogger = {
|
||||
silly: (...params) => console.log('silly', ...params),
|
||||
|
||||
Reference in New Issue
Block a user