Skip to content

Commit

Permalink
test: empty response data (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m authored Jan 26, 2023
1 parent 125c968 commit f38a3d8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/retry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,25 @@ describe("Automatic Retries", function () {
).toBeLessThan(20);
});

it("Should not throw for empty responses", async function () {
const octokit = new TestOctokit();

const response = await octokit.request("GET /test", {
request: {
responses: [
{
status: 200,
headers: {},
data: undefined,
},
],
retries: 1,
},
});

expect(response.data).toBeUndefined();
});

it('Should not retry non-"Something went wrong" GraphQL errors', async function () {
const octokit = new TestOctokit();

Expand Down

0 comments on commit f38a3d8

Please sign in to comment.