Skip to content

Commit 9da6a4f

Browse files
authored
fix: fix stats and language tests (#3)
* fix: fix stats and language tests * fix: fixes uncatched merge conflicts * fix: remove hide argument from 'fetchTopLanguages' call This commit removes the `hide` argument from the `fetchTopLanguages` call found in the `top-lang.js` file. This was done since this was leftover from 465faa7.
1 parent 4a4cec6 commit 9da6a4f

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

api/top-langs.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ module.exports = async (req, res) => {
4747
username,
4848
parseArray(role),
4949
parseArray(exclude_repo),
50-
parseArray(role),
51-
parseArray(hide),
5250
);
5351

5452
const cacheSeconds = clampValue(

src/fetchers/stats-fetcher.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ async function fetchStats(
9292
ownerAffiliations,
9393
count_private = false,
9494
include_all_commits = false,
95-
ownerAffiliations,
9695
) {
9796
if (!username) throw Error("Invalid username");
9897

tests/fetchStats.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe("Test fetchStats", () => {
5252
it("should fetch correct stats", async () => {
5353
mock.onPost("https://api.github.com/graphql").reply(200, data);
5454

55-
let stats = await fetchStats("anuraghazra");
55+
let stats = await fetchStats("anuraghazra", []);
5656
const rank = calculateRank({
5757
totalCommits: 100,
5858
totalRepos: 5,
@@ -77,15 +77,15 @@ describe("Test fetchStats", () => {
7777
it("should throw error", async () => {
7878
mock.onPost("https://api.github.com/graphql").reply(200, error);
7979

80-
await expect(fetchStats("anuraghazra")).rejects.toThrow(
80+
await expect(fetchStats("anuraghazra", [])).rejects.toThrow(
8181
"Could not resolve to a User with the login of 'noname'.",
8282
);
8383
});
8484

8585
it("should fetch and add private contributions", async () => {
8686
mock.onPost("https://api.github.com/graphql").reply(200, data);
8787

88-
let stats = await fetchStats("anuraghazra", true);
88+
let stats = await fetchStats("anuraghazra", [], true);
8989
const rank = calculateRank({
9090
totalCommits: 150,
9191
totalRepos: 5,
@@ -113,7 +113,7 @@ describe("Test fetchStats", () => {
113113
.onGet("https://api.github.com/search/commits?q=author:anuraghazra")
114114
.reply(200, { total_count: 1000 });
115115

116-
let stats = await fetchStats("anuraghazra", true, true);
116+
let stats = await fetchStats("anuraghazra", [], true, true);
117117
const rank = calculateRank({
118118
totalCommits: 1050,
119119
totalRepos: 5,

tests/fetchTopLanguages.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe("FetchTopLanguages", () => {
5959
it("should fetch correct language data", async () => {
6060
mock.onPost("https://api.github.com/graphql").reply(200, data_langs);
6161

62-
let repo = await fetchTopLanguages("anuraghazra");
62+
let repo = await fetchTopLanguages("anuraghazra", []);
6363
expect(repo).toStrictEqual({
6464
HTML: {
6565
color: "#0f0",
@@ -77,7 +77,7 @@ describe("FetchTopLanguages", () => {
7777
it("should throw error", async () => {
7878
mock.onPost("https://api.github.com/graphql").reply(200, error);
7979

80-
await expect(fetchTopLanguages("anuraghazra")).rejects.toThrow(
80+
await expect(fetchTopLanguages("anuraghazra", [])).rejects.toThrow(
8181
"Could not resolve to a User with the login of 'noname'.",
8282
);
8383
});

0 commit comments

Comments
 (0)