Skip to content

Commit fcdd721

Browse files
renovate[bot]Create or Update Pull Request Actionkfcampbell
authored
chore(deps): update dependency prettier to v3 (#449)
* chore(deps): update dependency prettier to v3 * style: prettier * Empty commit to trigger test run --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Create or Update Pull Request Action <[email protected]> Co-authored-by: Keegan Campbell <[email protected]>
1 parent 7ae9006 commit fcdd721

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const octokit = new MyOctokit({ auth: "secret123" });
4646
octokit.request("/").catch((error) => {
4747
if (error.request.request.retryCount) {
4848
console.log(
49-
`request failed after ${error.request.request.retryCount} retries`
49+
`request failed after ${error.request.request.retryCount} retries`,
5050
);
5151
}
5252

@@ -84,7 +84,7 @@ octokit
8484
.catch((error) => {
8585
if (error.request.request.retryCount) {
8686
console.log(
87-
`request failed after ${error.request.request.retryCount} retries`
87+
`request failed after ${error.request.request.retryCount} retries`,
8888
);
8989
}
9090

package-lock.json

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

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"fetch-mock": "^9.0.0",
3434
"glob": "^10.2.6",
3535
"jest": "^29.0.0",
36-
"prettier": "2.8.8",
36+
"prettier": "3.0.0",
3737
"semantic-release-plugin-update-version-in-files": "^1.0.0",
3838
"ts-jest": "^29.0.0",
3939
"typescript": "^5.0.0"

src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function retry(octokit: Octokit, octokitOptions: any) {
1414
doNotRetry: [400, 401, 403, 404, 422, 451],
1515
retries: 3,
1616
},
17-
octokitOptions.retry
17+
octokitOptions.retry,
1818
);
1919

2020
if (state.enabled) {
@@ -27,7 +27,7 @@ export function retry(octokit: Octokit, octokitOptions: any) {
2727
retryRequest: (
2828
error: RequestError,
2929
retries: number,
30-
retryAfter: number
30+
retryAfter: number,
3131
) => {
3232
error.request.request = Object.assign({}, error.request.request, {
3333
retries: retries,

src/wrap-request.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ export async function wrapRequest(state, octokit, request, options) {
2020

2121
return limiter.schedule(
2222
requestWithGraphqlErrorHandling.bind(null, state, octokit, request),
23-
options
23+
options,
2424
);
2525
}
2626

2727
async function requestWithGraphqlErrorHandling(
2828
state,
2929
octokit,
3030
request,
31-
options
31+
options,
3232
) {
3333
const response = await request(request, options);
3434

3535
if (
3636
response.data &&
3737
response.data.errors &&
3838
/Something went wrong while executing your query/.test(
39-
response.data.errors[0].message
39+
response.data.errors[0].message,
4040
)
4141
) {
4242
// simulate 500 request error for retry handling

test/retry.test.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe("Automatic Retries", function () {
4848
]);
4949

5050
expect(
51-
octokit.__requestTimings[1] - octokit.__requestTimings[0]
51+
octokit.__requestTimings[1] - octokit.__requestTimings[0],
5252
).toBeLessThan(20);
5353
});
5454

@@ -77,10 +77,10 @@ describe("Automatic Retries", function () {
7777
"START GET /route",
7878
]);
7979
expect(
80-
octokit.__requestTimings[1] - octokit.__requestTimings[0]
80+
octokit.__requestTimings[1] - octokit.__requestTimings[0],
8181
).toBeLessThan(20);
8282
expect(
83-
octokit.__requestTimings[2] - octokit.__requestTimings[1]
83+
octokit.__requestTimings[2] - octokit.__requestTimings[1],
8484
).toBeLessThan(20);
8585
});
8686

@@ -134,7 +134,7 @@ describe("Automatic Retries", function () {
134134

135135
// null (0) retryAfter
136136
expect(
137-
octokit.__requestTimings[3] - octokit.__requestTimings[2]
137+
octokit.__requestTimings[3] - octokit.__requestTimings[2],
138138
).toBeLessThan(20);
139139
});
140140

@@ -228,7 +228,7 @@ describe("Automatic Retries", function () {
228228

229229
expect(caught).toEqual(testStatuses.length);
230230
expect(octokit.__requestLog).toStrictEqual(
231-
testStatuses.map(() => "START GET /route")
231+
testStatuses.map(() => "START GET /route"),
232232
);
233233
});
234234

@@ -319,7 +319,7 @@ describe("Automatic Retries", function () {
319319
]);
320320

321321
expect(
322-
octokit.__requestTimings[1] - octokit.__requestTimings[0]
322+
octokit.__requestTimings[1] - octokit.__requestTimings[0],
323323
).toBeLessThan(20);
324324
});
325325

@@ -385,7 +385,7 @@ describe("Automatic Retries", function () {
385385
} catch (error: any) {
386386
expect(error.name).toEqual("GraphqlResponseError");
387387
expect(error.message).toContain(
388-
"Something that cannot be fixed with a request retry"
388+
"Something that cannot be fixed with a request retry",
389389
);
390390
}
391391

@@ -395,7 +395,7 @@ describe("Automatic Retries", function () {
395395
]);
396396

397397
expect(
398-
octokit.__requestTimings[1] - octokit.__requestTimings[0]
398+
octokit.__requestTimings[1] - octokit.__requestTimings[0],
399399
).toBeLessThan(20);
400400
});
401401
});
@@ -421,7 +421,7 @@ describe("errorRequest", function () {
421421
const error = new RequestError(
422422
"Internal server error",
423423
500,
424-
errorOptions
424+
errorOptions,
425425
) as any;
426426
delete error.request;
427427

0 commit comments

Comments
 (0)