mirror of
https://github.com/Aviortheking/codestats-readme.git
synced 2025-07-28 23:09:51 +00:00
fix: filter out private repos
filtering out private repos just in case, otherwise if a user somehow found out the name of any of the PAT owner's private - (considering they created the PAT with private repo access) repos's name then they could see the repo in github extra pins.
This commit is contained in:
@ -80,4 +80,17 @@ describe("Test fetchRepo", () => {
|
||||
"Not found"
|
||||
);
|
||||
});
|
||||
|
||||
it("should throw error if repository is private", async () => {
|
||||
mock.onPost("https://api.github.com/graphql").reply(200, {
|
||||
data: {
|
||||
user: { repository: { ...data_repo, isPrivate: true } },
|
||||
organization: null,
|
||||
},
|
||||
});
|
||||
|
||||
await expect(fetchRepo("anuraghazra", "convoychat")).rejects.toThrow(
|
||||
"User Repository Not found"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user