From 15620a11db5c57c5ac066ba4b0caf31a09c65ea7 Mon Sep 17 00:00:00 2001 From: rickstaa Date: Fri, 7 Oct 2022 12:42:04 +0200 Subject: [PATCH] test: fix tests --- src/fetchers/stats-fetcher.js | 2 +- tests/fetchStats.test.js | 30 +++++++++++++++++++----------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/fetchers/stats-fetcher.js b/src/fetchers/stats-fetcher.js index 4094756..941c7e1 100644 --- a/src/fetchers/stats-fetcher.js +++ b/src/fetchers/stats-fetcher.js @@ -155,7 +155,7 @@ const totalStarsFetcher = async (username, repoToHide) => { // hasNextPage = // allNodes.length === nodesWithStars.length && // res.data.data.user.repositories.pageInfo.hasNextPage; - hasNextPage = false; // NOTE: Temporarily disable fetching of multiple pages. + hasNextPage = false; // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. endCursor = res.data.data.user.repositories.pageInfo.endCursor; } diff --git a/tests/fetchStats.test.js b/tests/fetchStats.test.js index 9ccdcb2..192146e 100644 --- a/tests/fetchStats.test.js +++ b/tests/fetchStats.test.js @@ -97,9 +97,9 @@ beforeEach(() => { .onPost("https://api.github.com/graphql") .replyOnce(200, data) .onPost("https://api.github.com/graphql") - .replyOnce(200, firstRepositoriesData) - .onPost("https://api.github.com/graphql") - .replyOnce(200, secondRepositoriesData); + .replyOnce(200, firstRepositoriesData); + // .onPost("https://api.github.com/graphql") // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. + // .replyOnce(200, secondRepositoriesData); // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. }); afterEach(() => { @@ -114,7 +114,8 @@ describe("Test fetchStats", () => { totalRepos: 5, followers: 100, contributions: 61, - stargazers: 400, + // stargazers: 400, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. + stargazers: 300, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. prs: 300, issues: 200, }); @@ -125,7 +126,8 @@ describe("Test fetchStats", () => { totalCommits: 100, totalIssues: 200, totalPRs: 300, - totalStars: 400, + // totalStars: 400, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. + totalStars: 300, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. rank, }); }); @@ -176,7 +178,8 @@ describe("Test fetchStats", () => { totalRepos: 5, followers: 100, contributions: 61, - stargazers: 400, + // stargazers: 400, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. + stargazers: 300, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. prs: 300, issues: 200, }); @@ -187,7 +190,8 @@ describe("Test fetchStats", () => { totalCommits: 150, totalIssues: 200, totalPRs: 300, - totalStars: 400, + // totalStars: 400, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. + totalStars: 300, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. rank, }); }); @@ -203,7 +207,8 @@ describe("Test fetchStats", () => { totalRepos: 5, followers: 100, contributions: 61, - stargazers: 400, + // stargazers: 400, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. + stargazers: 300, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. prs: 300, issues: 200, }); @@ -214,7 +219,8 @@ describe("Test fetchStats", () => { totalCommits: 1050, totalIssues: 200, totalPRs: 300, - totalStars: 400, + // totalStars: 400, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. + totalStars: 300, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. rank, }); }); @@ -230,7 +236,8 @@ describe("Test fetchStats", () => { totalRepos: 5, followers: 100, contributions: 61, - stargazers: 300, + // stargazers: 300, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. + stargazers: 200, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. prs: 300, issues: 200, }); @@ -241,7 +248,8 @@ describe("Test fetchStats", () => { totalCommits: 1050, totalIssues: 200, totalPRs: 300, - totalStars: 300, + // totalStars: 300, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. + totalStars: 200, // NOTE: Temporarily disable fetching of multiple pages. Done because of #2130. rank, }); });