Skip to content

Commit 0e0b5df

Browse files
developStormrickstaa
authored andcommitted
1 parent 81ff6d6 commit 0e0b5df

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

api/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ module.exports = async (req, res) => {
4848
try {
4949
const stats = await fetchStats(
5050
username,
51+
parseArray(role),
5152
parseBoolean(count_private),
5253
parseBoolean(include_all_commits),
53-
parseArray(role),
5454
);
5555

5656
const cacheSeconds = clampValue(

api/top-langs.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ module.exports = async (req, res) => {
4545
try {
4646
const topLangs = await fetchTopLanguages(
4747
username,
48-
parseArray(exclude_repo),
4948
parseArray(role),
50-
parseArray(hide),
49+
parseArray(exclude_repo),
5150
);
5251

5352
const cacheSeconds = clampValue(

src/fetchers/stats-fetcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ const totalCommitsFetcher = async (username) => {
105105
*/
106106
async function fetchStats(
107107
username,
108+
ownerAffiliations,
108109
count_private = false,
109110
include_all_commits = false,
110-
ownerAffiliations,
111111
) {
112112
if (!username) throw new MissingParamError(["username"]);
113113

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
@@ -63,7 +63,7 @@ describe("FetchTopLanguages", () => {
6363
it("should fetch correct language data", async () => {
6464
mock.onPost("https://api.github.com/graphql").reply(200, data_langs);
6565

66-
let repo = await fetchTopLanguages("anuraghazra");
66+
let repo = await fetchTopLanguages("anuraghazra", []);
6767
expect(repo).toStrictEqual({
6868
HTML: {
6969
color: "#0f0",
@@ -99,7 +99,7 @@ describe("FetchTopLanguages", () => {
9999
it("should throw error", async () => {
100100
mock.onPost("https://api.github.com/graphql").reply(200, error);
101101

102-
await expect(fetchTopLanguages("anuraghazra")).rejects.toThrow(
102+
await expect(fetchTopLanguages("anuraghazra", [])).rejects.toThrow(
103103
"Could not resolve to a User with the login of 'noname'.",
104104
);
105105
});

0 commit comments

Comments
 (0)