MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / createMockRepo

Function createMockRepo

packages/backend/src/repoIndexManager.test.ts:197–219  ·  view source on GitHub ↗
(overrides: Partial<Repo> = {})

Source from the content-addressed store, hash-verified

195
196// Helper to create a mock repo
197const createMockRepo = (overrides: Partial<Repo> = {}): Repo => ({
198 id: 1,
199 name: 'test-repo',
200 cloneUrl: 'https://github.com/test/repo.git',
201 orgId: 1,
202 indexedAt: null,
203 indexedCommitHash: null,
204 defaultBranch: 'main',
205 metadata: {},
206 repoIndexingStatus: 'CREATED',
207 latestIndexingJobStatus: null,
208 latestConnectionSyncJobStatus: null,
209 external_id: 'test-external-id',
210 external_codeHostType: 'github',
211 external_codeHostUrl: 'https://github.com',
212 pushedAt: null,
213 createdAt: new Date(),
214 updatedAt: new Date(),
215 isFork: false,
216 isArchived: false,
217 isAutoCleanupDisabled: false,
218 ...overrides,
219} as Repo);
220
221// Helper to create a mock repoWithConnections
222const createMockRepoWithConnections = (overrides: Partial<RepoWithConnections> = {}): RepoWithConnections => ({

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected