Skip to content

Commit 9d684fe

Browse files
committed
more test
1 parent 59b678b commit 9d684fe

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/event_processor/event_processor_factory.node.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,15 @@ describe('createBatchEventProcessor', () => {
190190
expect(mockGetBatchEventProcessor.mock.calls[0][0].retryOptions?.maxRetries).toBe(10);
191191
});
192192

193-
it('uses the default failedEventRetryInterval', () => {
193+
it('uses no failed event retry if an eventStore is not provided', () => {
194194
const processor = createBatchEventProcessor({ });
195195
expect(Object.is(processor, mockGetBatchEventProcessor.mock.results[0].value)).toBe(true);
196+
expect(mockGetBatchEventProcessor.mock.calls[0][0].failedEventRetryInterval).toBe(undefined);
197+
});
198+
199+
it('uses the default failedEventRetryInterval if an eventStore is provided', () => {
200+
const processor = createBatchEventProcessor({ eventStore: {} as any });
201+
expect(Object.is(processor, mockGetBatchEventProcessor.mock.results[0].value)).toBe(true);
196202
expect(mockGetBatchEventProcessor.mock.calls[0][0].failedEventRetryInterval).toBe(FAILED_EVENT_RETRY_INTERVAL);
197203
});
198204
});

lib/event_processor/event_processor_factory.node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const createBatchEventProcessor = (
3939
retryOptions: {
4040
maxRetries: 10,
4141
},
42-
failedEventRetryInterval: FAILED_EVENT_RETRY_INTERVAL,
42+
failedEventRetryInterval: eventStore ? FAILED_EVENT_RETRY_INTERVAL : undefined,
4343
eventStore,
4444
});
4545
};

0 commit comments

Comments
 (0)