(addons)
| 39 | ], |
| 40 | }; |
| 41 | export 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 | |
| 70 | export default function createMockGithubInstance(repoDirectory) { |
| 71 | return { |
nothing calls this directly
no test coverage detected