Files
github-stats-extended/apps/backend/tests/test-data/api-data.js
T
Martin 6e109e50d1 restructure tests, add tests, remove dotenv (#83)
- add a few tests
- re-organize tests to allow testing with different env vars and
creating a combined coverage report
- extract test data into separate files, because importing data from
testA in testB leads to weird jest errors
- remove `dotenv` because it's not being used
- "GitHub Trends" -> "GitHub Stats Extended"
2026-02-20 19:38:16 +01:00

52 lines
1.3 KiB
JavaScript

// @ts-check
/**
* @type {import("../../src/fetchers/stats").StatsData}
*/
export const stats = {
name: "Anurag Hazra",
totalStars: 100,
totalCommits: 200,
totalIssues: 300,
totalPRs: 400,
totalPRsMerged: 320,
mergedPRsPercentage: 80,
totalReviews: 50,
totalDiscussionsStarted: 10,
totalDiscussionsAnswered: 40,
contributedTo: 50,
rank: { level: "DEV", percentile: 0 },
};
export const data_stats = {
data: {
user: {
name: stats.name,
repositoriesContributedTo: { totalCount: stats.contributedTo },
commits: {
totalCommitContributions: stats.totalCommits,
},
reviews: {
totalPullRequestReviewContributions: stats.totalReviews,
},
pullRequests: { totalCount: stats.totalPRs },
mergedPullRequests: { totalCount: stats.totalPRsMerged },
openIssues: { totalCount: stats.totalIssues },
closedIssues: { totalCount: 0 },
followers: { totalCount: 0 },
repositoryDiscussions: { totalCount: stats.totalDiscussionsStarted },
repositoryDiscussionComments: {
totalCount: stats.totalDiscussionsAnswered,
},
repositories: {
totalCount: 1,
nodes: [{ stargazers: { totalCount: 100 } }],
pageInfo: {
hasNextPage: false,
endCursor: "cursor",
},
},
},
},
};