Skip to content

Commit 848925b

Browse files
fix: adapt for latest @octokit/types (#293)
* build(deps): bump @octokit/types from 6.0.0 to 6.0.1 Bumps [@octokit/types](https://github.com/octokit/types.ts) from 6.0.0 to 6.0.1. - [Release notes](https://github.com/octokit/types.ts/releases) - [Commits](octokit/types.ts@v6.0.0...v6.0.1) Signed-off-by: dependabot[bot] <[email protected]>
1 parent 80c8363 commit 848925b

File tree

3 files changed

+93
-96
lines changed

3 files changed

+93
-96
lines changed

package-lock.json

Lines changed: 85 additions & 86 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"author": "Gregor Martynus (https://twitter.com/gr2m)",
2525
"license": "MIT",
2626
"dependencies": {
27-
"@octokit/types": "^6.0.0",
27+
"@octokit/types": "^6.0.3",
2828
"deprecation": "^2.3.1"
2929
},
3030
"devDependencies": {

test/rest-endpoint-methods.test.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe("REST API endpoint methods", () => {
77
it("README example", async () => {
88
const mock = fetchMock.sandbox().post(
99
"path:/user/repos",
10-
{ ok: true },
10+
{ id: 1 },
1111
{
1212
body: {
1313
name: "my-new-repo",
@@ -28,19 +28,17 @@ describe("REST API endpoint methods", () => {
2828
name: "my-new-repo",
2929
});
3030

31-
expect(data).toStrictEqual({ ok: true });
31+
expect(data.id).toStrictEqual(1);
3232
});
3333

3434
it("Required preview header", async () => {
35-
const mock = fetchMock.sandbox().getOnce(
36-
"path:/codes_of_conduct",
37-
{ ok: true },
38-
{
35+
const mock = fetchMock
36+
.sandbox()
37+
.getOnce("path:/codes_of_conduct", [{ key: "mit" }], {
3938
headers: {
4039
accept: "application/vnd.github.scarlet-witch-preview+json",
4140
},
42-
}
43-
);
41+
});
4442

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

55-
expect(data).toStrictEqual({ ok: true });
53+
expect(data[0].key).toStrictEqual("mit");
5654
});
5755

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

0 commit comments

Comments
 (0)