From 1f1edaf0dc8dbe9d381fa84b9ddc9be3737feaa4 Mon Sep 17 00:00:00 2001 From: Vincent Chau <99756290+vincentwschau@users.noreply.github.com> Date: Tue, 7 May 2024 12:26:19 -0400 Subject: [PATCH] Remove messages in beforeAll --- .../__tests__/lib/message-forwarder.test.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/indexer/services/socks/__tests__/lib/message-forwarder.test.ts b/indexer/services/socks/__tests__/lib/message-forwarder.test.ts index 9e85f5e37f..8786d6835a 100644 --- a/indexer/services/socks/__tests__/lib/message-forwarder.test.ts +++ b/indexer/services/socks/__tests__/lib/message-forwarder.test.ts @@ -192,6 +192,20 @@ describe('message-forwarder', () => { subscriptions = new Subscriptions(); index = new Index(wss, subscriptions); (axiosRequest as jest.Mock).mockImplementation(() => (JSON.stringify(mockAxiosResponse))); + await admin.deleteTopicRecords({ + topic: WebsocketTopics.TO_WEBSOCKETS_TRADES, + partitions: [{ + partition: 0, + offset: '-1', + }], + }); + await admin.deleteTopicRecords({ + topic: WebsocketTopics.TO_WEBSOCKETS_SUBACCOUNTS, + partitions: [{ + partition: 0, + offset: '-1', + }], + }); }); afterEach(() => { @@ -422,7 +436,7 @@ describe('message-forwarder', () => { }); }); - /*it('forwards messages', (done: jest.DoneCallback) => { + it('forwards messages', (done: jest.DoneCallback) => { const channel: Channel = Channel.V4_TRADES; const id: string = ethTicker; @@ -494,7 +508,7 @@ describe('message-forwarder', () => { batched: false, })); }); - });*/ + }); }); function checkInitialMessage(