Skip to content

Commit

Permalink
style: Update mock function signature in handler and remove unnecessa…
Browse files Browse the repository at this point in the history
…ry comment in util test.
  • Loading branch information
wajeht committed Aug 2, 2024
1 parent 4b10396 commit 442ef66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ describe('getIndexHandler', () => {

describe('postGenerateCommitMessageHandler', () => {
const createMockAIService = (mockMessage: string | null) => ({
generate: mock.fn<(diff: string) => Promise<string | null>>(() => Promise.resolve(mockMessage)),
generate: mock.fn<(diff: string, apiKey?: string) => Promise<string | null>>(() =>
Promise.resolve(mockMessage),
),
});

const createMockAIFactory = (mockService: AIService) =>
Expand Down
1 change: 0 additions & 1 deletion src/util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ describe('validateConfig', () => {
let loggerOutput: string;

beforeEach(() => {
// Mock logger.error
originalLoggerError = logger.error;
loggerOutput = '';

Expand Down

0 comments on commit 442ef66

Please sign in to comment.