Skip to content

Commit

Permalink
✅ throw error if no GitHub PAT
Browse files Browse the repository at this point in the history
  • Loading branch information
rkotze committed Oct 4, 2020
1 parent 335bc7e commit 0629903
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/github/github-api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,16 @@ describe("requests to github api", function () {

expect(result).toEqual({ data: { items: [1] } });
});

it("no api key found", async function () {
workspace.getConfiguration.mockReturnValue({
get() {
return null;
},
});

await expect(get("search/users")).rejects.toThrow(
"No GitHub personal access token found"
);
});
});

0 comments on commit 0629903

Please sign in to comment.