From b56246848d307a23f41078070b61ca795b67668e Mon Sep 17 00:00:00 2001 From: Darun Seethammagari Date: Mon, 18 Dec 2023 09:37:52 -0800 Subject: [PATCH] Passing test --- runner/src/service/runner-service.test.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/runner/src/service/runner-service.test.ts b/runner/src/service/runner-service.test.ts index 375fede79..87786292d 100644 --- a/runner/src/service/runner-service.test.ts +++ b/runner/src/service/runner-service.test.ts @@ -9,16 +9,25 @@ describe('Runner gRPC Service', () => { }); }); - it('starts a stream', () => { + it('starts a stream with correct settings', () => { const service = getRunnerService(genericStreamHandlerType); const mockCallback = jest.fn() as unknown as any; + const redisStream = 'test-redis-stream'; + const indexerConfig = { + account_id: 'test-account-id', + function_name: 'test-function-name', + code: 'test-code', + schema: 'test-schema', + }; const request = { request: { streamId: 'test-stream-id', + redisStream, + indexerConfig: JSON.stringify(indexerConfig), } } as unknown as any; service.StartStream(request, mockCallback); - // expect(genericStreamHandlerType).toHaveBeenCalledWith(undefined, undefined); - expect(mockCallback).toHaveBeenCalledWith({}, { streamId: 'test-stream-id' }); + expect(genericStreamHandlerType).toHaveBeenCalledWith(redisStream, indexerConfig); + expect(mockCallback).toHaveBeenCalledWith(null, { streamId: 'test-stream-id' }); }); });