Skip to content

Commit f38a3d8

Browse files
authored
test: empty response data (#398)
1 parent 125c968 commit f38a3d8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/retry.test.ts

+19
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,25 @@ describe("Automatic Retries", function () {
323323
).toBeLessThan(20);
324324
});
325325

326+
it("Should not throw for empty responses", async function () {
327+
const octokit = new TestOctokit();
328+
329+
const response = await octokit.request("GET /test", {
330+
request: {
331+
responses: [
332+
{
333+
status: 200,
334+
headers: {},
335+
data: undefined,
336+
},
337+
],
338+
retries: 1,
339+
},
340+
});
341+
342+
expect(response.data).toBeUndefined();
343+
});
344+
326345
it('Should not retry non-"Something went wrong" GraphQL errors', async function () {
327346
const octokit = new TestOctokit();
328347

0 commit comments

Comments
 (0)