Skip to content

Commit

Permalink
test: remove duplicate test
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy1339 committed Nov 29, 2023
1 parent bafecb3 commit 02c662c
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions test/request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,13 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
.sandbox()
.get("path:/repos/octokit-fixture-org/hello-world/contents/README.md", {
status: 500,
body: undefined,
body: "",
headers: {
"content-type": "application/json",
},
});

expect(request).not.toThrow();
return request("GET /repos/{owner}/{repo}/contents/{path}", {
headers: {
accept: "content-type: application/json",
Expand Down Expand Up @@ -1120,27 +1121,4 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
expect(mock.done()).toBe(true);
});
});

it("should not error for empty response body and json media type (#649)", () => {
const mock = fetchMock.sandbox().get("path:/", {
status: 200,
body: "",
headers: {
"content-length": "0",
"content-type": "application/json; charset=utf-8",
},
});

expect(request).not.toThrow();
return request("GET /", {
headers: {
accept: "application/json",
},
request: {
fetch: mock,
},
}).then((response) => {
expect(response.data).toEqual("");
});
});
});

0 comments on commit 02c662c

Please sign in to comment.