From 98c58cbeb9612120936ccee6b4ec02e84dc0410f Mon Sep 17 00:00:00 2001 From: Shivaditya Shivganesh Date: Sat, 9 Nov 2024 03:13:06 -0500 Subject: [PATCH] fix: tests --- tests/__mocks__/adapter.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/__mocks__/adapter.ts b/tests/__mocks__/adapter.ts index abb271f..dc95cb1 100644 --- a/tests/__mocks__/adapter.ts +++ b/tests/__mocks__/adapter.ts @@ -12,6 +12,13 @@ export interface CommentMock { embedding: number[]; } +export interface IssueMock { + id: string; + plaintext: string; + author_id: number; + payload: Record; +} + export function createMockAdapters(context: Context) { const commentMap: Map = new Map(); return { @@ -72,6 +79,18 @@ export function createMockAdapters(context: Context) { return commentMap.get(commentNodeId); }), } as unknown as Comment, + issue: { + getIssue: jest.fn(async (issueNodeId: string) => { + return [ + { + id: issueNodeId, + plaintext: STRINGS.HELLO_WORLD, + author_id: 1, + payload: {}, + } as IssueMock, + ]; + }), + }, }, voyage: { embedding: {