Open
Conversation
- Expand Farm.test.ts with edge cases (empty arrays, multiple animals, unrecognized types) - Add AstforFile.test.ts: 10 tests for ASTForFile/ASTForFileToFile with mocked tree-sitter and fs - Add GetDiffForFile.test.ts: 13 tests for getSuggestionsFromGPT with mocked OpenAI - Add IssuesTester.test.ts: 15 tests for Probot issues.opened/closed handlers - Add index.test.ts: 16 tests for pull_request.opened/closed/reopened handlers All 71 tests pass with no real API calls made. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| issue: vi.fn((extras?: Record<string, unknown>) => ({ | ||
| owner: "test-owner", | ||
| repo: "test-repo", | ||
| issue_number: 1, |
There was a problem hiding this comment.
Mock context issue_number inconsistent with payload number
Medium Severity
The createMockContext helper returns issue_number: 1 from context.issue(), but payload.issue.number is 42. In real Probot, context.issue() derives issue_number from the payload, so these values are always in sync. This mismatch means all ghIssueComment calls in tests target issue #1 instead of #42, creating an inaccurate simulation that could mask bugs where the wrong issue number is used for posting comments, adding labels, or other issue-scoped operations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
ASTForFileandASTForFileToFile, using mockedtree-sitterandfsmodulesgetSuggestionsFromGPTwith mocked OpenAIissues.openedandissues.closedhandlerspull_request.opened/closed/reopenedhandlersTotal: 71 tests across 5 test files — all passing.
Test plan
npm test(vitest run) passes all 71 tests🤖 Generated with Claude Code
Note
Low Risk
Low risk: adds/expands Vitest test suites only, with external services (OpenAI, Runloop, tree-sitter, fs) fully mocked and no production logic changes.
Overview
Adds a comprehensive Vitest suite (71 tests) covering
ASTForFile/ASTForFileToFile,getSuggestionsFromGPT(including default options, error paths, and line-number resolution), and the Probot issue/PR handlers (issues.opened/closed,pull_request.opened/closed/reopened) with mocked Runloop/OpenAI.Expands
Farm.test.tsto cover additional edge cases (empty input, repeated animals, unrecognized animals, larger mixes) and reorganizes tests into clearerdescribeblocks.Written by Cursor Bugbot for commit eaec782. This will update automatically on new commits. Configure here.