Skip to content

fix: adapt for latest @octokit/types #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 85 additions & 86 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"author": "Gregor Martynus (https://twitter.com/gr2m)",
"license": "MIT",
"dependencies": {
"@octokit/types": "^6.0.0",
"@octokit/types": "^6.0.3",
"deprecation": "^2.3.1"
},
"devDependencies": {
Expand Down
16 changes: 7 additions & 9 deletions test/rest-endpoint-methods.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe("REST API endpoint methods", () => {
it("README example", async () => {
const mock = fetchMock.sandbox().post(
"path:/user/repos",
{ ok: true },
{ id: 1 },
{
body: {
name: "my-new-repo",
Expand All @@ -28,19 +28,17 @@ describe("REST API endpoint methods", () => {
name: "my-new-repo",
});

expect(data).toStrictEqual({ ok: true });
expect(data.id).toStrictEqual(1);
});

it("Required preview header", async () => {
const mock = fetchMock.sandbox().getOnce(
"path:/codes_of_conduct",
{ ok: true },
{
const mock = fetchMock
.sandbox()
.getOnce("path:/codes_of_conduct", [{ key: "mit" }], {
headers: {
accept: "application/vnd.github.scarlet-witch-preview+json",
},
}
);
});

const MyOctokit = Octokit.plugin(restEndpointMethods);
const octokit = new MyOctokit({
Expand All @@ -52,7 +50,7 @@ describe("REST API endpoint methods", () => {
// See https://developer.github.com/v3/repos/#create-a-repository-dispatch-event
const { data } = await octokit.codesOfConduct.getAllCodesOfConduct();

expect(data).toStrictEqual({ ok: true });
expect(data[0].key).toStrictEqual("mit");
});

it("octokit.markdown.renderRaw()", async () => {
Expand Down