MCPcopy Create free account
hub / github.com/backstrokeapp/server / generateRepo

Function generateRepo

src/test-helpers/create-mock-github-instance.js:41–68  ·  view source on GitHub ↗
(addons)

Source from the content-addressed store, hash-verified

39 ],
40};
41export function generateRepo(addons) {
42 let {owner, name, isFork, branches, forks, issues, pullRequests, webhooks, parent} = Object.assign({}, BASE_REPO, addons);
43 let id = generateId();
44 return {
45 id,
46 name,
47 full_name: `${owner}/${name}`,
48 owner: generateOwner(owner),
49 parent,
50 private: false,
51 html_url: `https://github.com/${owner}/${name}`,
52 description: "I am a mock repository created for testing purposes.",
53 fork: isFork,
54 url: `https://api.github.com/repos/${owner}/${name}`,
55 stargazers_count: Math.floor(Math.random() * 500),
56 watchers_count: Math.floor(Math.random() * 500),
57 language: null,
58 forks_count: (forks || []).length,
59 forks: (forks || []).length,
60 organization: generateOwner(owner),
61
62 _branches: branches || [],
63 _forks: forks || [],
64 _issues: issues || [],
65 _pullRequests: pullRequests || [],
66 _webhooks: webhooks || [],
67 };
68}
69
70export default function createMockGithubInstance(repoDirectory) {
71 return {

Callers

nothing calls this directly

Calls 2

generateIdFunction · 0.85
generateOwnerFunction · 0.85

Tested by

no test coverage detected