Skip to content

Commit

Permalink
Update fetchTopLanguages.test.js
Browse files Browse the repository at this point in the history
Changed tests
  • Loading branch information
kitswas committed May 4, 2022
1 parent ac35267 commit 1fef47b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/fetchTopLanguages.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,31 +67,35 @@ describe("FetchTopLanguages", () => {
expect(repo).toStrictEqual({
HTML: {
color: "#0f0",
count: 2,
name: "HTML",
size: 200,
size: 20,
},
javascript: {
color: "#0ff",
count: 2,
name: "javascript",
size: 200,
size: 20,
},
});
});

it("should fetch correct language data while excluding the 'test-repo-1' repository", async () => {
mock.onPost("https://api.github.com/graphql").reply(200, data_langs);

let repo = await fetchTopLanguages("anuraghazra", exclude_repo=["test-repo-1"]);
let repo = await fetchTopLanguages("anuraghazra", exclude_repo = ["test-repo-1"]);
expect(repo).toStrictEqual({
HTML: {
color: "#0f0",
count: 1,
name: "HTML",
size: 100,
size: 10,
},
javascript: {
color: "#0ff",
count: 2,
name: "javascript",
size: 200,
size: 20,
},
});
});
Expand Down

0 comments on commit 1fef47b

Please sign in to comment.