remove duplicated tests, remove duplicated comment
This commit is contained in:
@@ -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<import("./types").StatsData>} Stats data.
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user