| 23 | const meta: RepoMeta = { provider: 'github', owner: 'owner', repo: 'repo' }; |
| 24 | |
| 25 | function makePR(overrides?: Partial<PRDetail>): PRDetail { |
| 26 | return { |
| 27 | number: 42, |
| 28 | title: 'Test PR', |
| 29 | state: 'open', |
| 30 | author: 'dev', |
| 31 | url: 'https://github.com/owner/repo/pull/42', |
| 32 | created_at: '2025-01-01', |
| 33 | updated_at: '2025-01-02', |
| 34 | base_branch: 'main', |
| 35 | head_branch: 'feature', |
| 36 | additions: 10, |
| 37 | deletions: 5, |
| 38 | body: 'PR description', |
| 39 | files: [ |
| 40 | { |
| 41 | path: 'src/main.ts', |
| 42 | status: 'modified', |
| 43 | additions: 5, |
| 44 | deletions: 2, |
| 45 | patch: '@@ -1,3 +1,5 @@\n+added', |
| 46 | }, |
| 47 | { |
| 48 | path: 'src/utils/helper.ts', |
| 49 | status: 'added', |
| 50 | additions: 10, |
| 51 | deletions: 0, |
| 52 | }, |
| 53 | ], |
| 54 | comments_count: 0, |
| 55 | review_comments_count: 0, |
| 56 | ...overrides, |
| 57 | }; |
| 58 | } |
| 59 | |
| 60 | describe('indexPRIntoGraph', () => { |
| 61 | it('creates PullRequest node with correct ID pattern', async () => { |