MCPcopy
hub / github.com/opentrace/opentrace / makePR

Function makePR

ui/src/pr/__tests__/indexer.test.ts:25–58  ·  view source on GitHub ↗
(overrides?: Partial<PRDetail>)

Source from the content-addressed store, hash-verified

23const meta: RepoMeta = { provider: 'github', owner: 'owner', repo: 'repo' };
24
25function 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
60describe('indexPRIntoGraph', () => {
61 it('creates PullRequest node with correct ID pattern', async () => {

Callers 1

indexer.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected