Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
dydxwill committed Mar 20, 2024
1 parent 13a8901 commit c1876d2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions indexer/packages/kafka/__tests__/batch-kafka-producer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('batch-kafka-producer', () => {
5,
[{ key: '1', value: 'a' }, { key: '2', value: 'b' }, { key: '3', value: 'c', headers: { timestamp: 'value' } }],
[[{ key: '1', value: 'a' }, { key: '2', value: 'b' }]],
[{ key: '3', value: 'c' }],
[{ key: '3', value: 'c', headers: { timestamp: 'value' } }],
],
[
'will not send message until the batch size is reached',
Expand Down Expand Up @@ -106,7 +106,9 @@ describe('batch-kafka-producer', () => {

for (const msg of messages) {
const key: Buffer | undefined = msg.key === undefined ? undefined : Buffer.from(msg.key);
batchProducer.addMessageAndMaybeFlush({ value: Buffer.from(msg.value), key, headers: msg.headers });
batchProducer.addMessageAndMaybeFlush(
{ value: Buffer.from(msg.value), key, headers: msg.headers },
);
}

expect(producerSendMock.mock.calls).toHaveLength(expectedMessagesPerCall.length);
Expand Down

0 comments on commit c1876d2

Please sign in to comment.