Skip to content

Commit

Permalink
fix: do not interfere with unhandled requests
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Nov 5, 2019
1 parent 9d270da commit ac7c38e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export function enterpriseCompatibility(octokit: Octokit) {
throw error;
});
}

return request(options);
}
);
}
Expand Down
9 changes: 6 additions & 3 deletions test/octokit-core.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,12 @@ describe("{POST|PUT} /repos/:owner/:repo/issues/:issue_number/labels", () => {
});

describe("GET /repos/:owner/:repo/issues/:issue_number/labels", () => {
it("has no effect on GET methods", () => {
it("has no effect on GET methods", async () => {
const mock = fetchMock
.sandbox()
.get("https://patched.test/repos/octokit/rest.js/issues/1/labels", 200);
.get("https://patched.test/repos/octokit/rest.js/issues/1/labels", {
ok: true
});

const octokitPatched = new OctokitWithPlugin({
baseUrl: "https://patched.test",
Expand All @@ -123,14 +125,15 @@ describe("GET /repos/:owner/:repo/issues/:issue_number/labels", () => {
}
});

return octokitPatched.request(
const { data } = await octokitPatched.request(
"GET /repos/:owner/:repo/issues/:issue_number/labels",
{
owner: "octokit",
repo: "rest.js",
issue_number: 1
}
);
expect(data).toStrictEqual({ ok: true });
});
});

Expand Down

0 comments on commit ac7c38e

Please sign in to comment.