Skip to content

Commit 9812323

Browse files
authoredDec 3, 2020
fix: adapt for latest @octokit/types (#1952)
1 parent e63852a commit 9812323

File tree

4 files changed

+71
-104
lines changed

4 files changed

+71
-104
lines changed
 

‎package-lock.json

+60-94
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
],
3333
"repository": "https://github.com/octokit/rest.js",
3434
"dependencies": {
35-
"@octokit/core": "^3.2.2",
36-
"@octokit/plugin-paginate-rest": "^2.6.1",
35+
"@octokit/core": "^3.2.3",
36+
"@octokit/plugin-paginate-rest": "^2.6.2",
3737
"@octokit/plugin-request-log": "^1.0.2",
38-
"@octokit/plugin-rest-endpoint-methods": "4.3.0"
38+
"@octokit/plugin-rest-endpoint-methods": "4.3.1"
3939
},
4040
"devDependencies": {
4141
"@octokit/auth": "^2.0.0",

‎test/scenarios/create-status.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ describe("api.github.com", () => {
4242
})
4343

4444
.then((response) => {
45+
// @ts-ignore type error likely caused by tempoaray workaround at https://github.com/octokit/types.ts/blob/2f664bcc543c0dd668645571839475f39f8c8b4b/scripts/update-endpoints/templates/endpoints.ts.template#L97-L99
4546
expect(response.data.length).toEqual(2);
4647

4748
return octokit.repos.getCombinedStatusForRef({

‎test/typescript-validate.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -134,22 +134,22 @@ export default async function () {
134134

135135
// pagination
136136
octokit
137-
.paginate("GET /repos/{owner}/{repo}/issues", {
137+
.paginate("GET /repos/{owner}/{repo}/labels", {
138138
owner: "octokit",
139139
repo: "rest.js",
140140
})
141-
.then((issues) => {
142-
// issues is an array of all issue objects
141+
.then((labels) => {
142+
// labels is an array of all issue objects
143143
});
144144

145145
octokit
146146
.paginate(
147-
"GET /repos/{owner}/{repo}/issues",
147+
"GET /repos/{owner}/{repo}/labels",
148148
{ owner: "octokit", repo: "rest.js" },
149-
(response) => response.data.map((issue) => issue.title)
149+
(response) => response.data.map((label) => label.name)
150150
)
151-
.then((issueTitles) => {
152-
// issueTitles is now an array with the titles only
151+
.then((labelNames) => {
152+
// labelNames is now an array with the names only
153153
});
154154

155155
const options = octokit.issues.listForRepo.endpoint.merge({

0 commit comments

Comments
 (0)
Please sign in to comment.