From 39f93a72293a70541e89c5257dceb7b065372f8d Mon Sep 17 00:00:00 2001 From: martin-mfg <2026226+martin-mfg@users.noreply.github.com> Date: Sun, 2 Nov 2025 12:24:11 +0100 Subject: [PATCH] remove duplicated tests, remove duplicated comment --- backend/src/fetchers/stats.js | 1 - backend/tests/fetchStats.test.js | 71 -------------------------------- 2 files changed, 72 deletions(-) diff --git a/backend/src/fetchers/stats.js b/backend/src/fetchers/stats.js index 429cb07e..7d699741 100644 --- a/backend/src/fetchers/stats.js +++ b/backend/src/fetchers/stats.js @@ -300,7 +300,6 @@ const fetchRepoUserStats = async ( * @param {boolean} include_merged_pull_requests Include merged pull requests. * @param {boolean} include_discussions Include discussions. * @param {boolean} include_discussions_answers Include discussions answers. - * @param {string[]} ownerAffiliations Owner affiliations. Default: OWNER. * @param {number|undefined} commits_year Year to count total commits * @param {string[]} ownerAffiliations Owner affiliations. Default: OWNER. * @returns {Promise} Stats data. diff --git a/backend/tests/fetchStats.test.js b/backend/tests/fetchStats.test.js index 8ad0bab5..a644c69f 100644 --- a/backend/tests/fetchStats.test.js +++ b/backend/tests/fetchStats.test.js @@ -555,75 +555,4 @@ describe("Test fetchStats", () => { rank, }); }); - - it("should get commits of provided year", async () => { - let stats = await fetchStats( - "anuraghazra", - false, - [], - false, - false, - false, - 2003, - ); - - const rank = calculateRank({ - all_commits: false, - commits: 428, - prs: 300, - reviews: 50, - issues: 200, - repos: 5, - stars: 300, - followers: 100, - }); - - expect(stats).toStrictEqual({ - contributedTo: 61, - name: "Anurag Hazra", - totalCommits: 428, - totalIssues: 200, - totalPRs: 300, - totalPRsMerged: 0, - mergedPRsPercentage: 0, - totalReviews: 50, - totalStars: 300, - totalDiscussionsStarted: 0, - totalDiscussionsAnswered: 0, - rank, - }); - }); - - it("should return correct data when user don't have any pull requests", async () => { - mock.reset(); - mock - .onPost("https://api.github.com/graphql") - .reply(200, data_without_pull_requests); - const stats = await fetchStats("anuraghazra", false, [], true); - const rank = calculateRank({ - all_commits: false, - commits: 100, - prs: 0, - reviews: 50, - issues: 200, - repos: 5, - stars: 300, - followers: 100, - }); - - expect(stats).toStrictEqual({ - contributedTo: 61, - name: "Anurag Hazra", - totalCommits: 100, - totalIssues: 200, - totalPRs: 0, - totalPRsMerged: 0, - mergedPRsPercentage: 0, - totalReviews: 50, - totalStars: 300, - totalDiscussionsStarted: 0, - totalDiscussionsAnswered: 0, - rank, - }); - }); });