Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sshivaditya committed Nov 9, 2024
1 parent f698377 commit 98c58cb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/__mocks__/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ export interface CommentMock {
embedding: number[];
}

export interface IssueMock {
id: string;
plaintext: string;
author_id: number;
payload: Record<string, unknown>;
}

export function createMockAdapters(context: Context) {
const commentMap: Map<string, CommentMock> = new Map();
return {
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit 98c58cb

Please sign in to comment.