Skip to content

Commit

Permalink
Passing test
Browse files Browse the repository at this point in the history
  • Loading branch information
darunrs committed Dec 18, 2023
1 parent 8c55f73 commit b562468
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions runner/src/service/runner-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
});
});

0 comments on commit b562468

Please sign in to comment.