diff --git a/docs/src/components/endpoint-group.js b/docs/src/components/endpoint-group.js
index 5ec2461d..e86be20e 100644
--- a/docs/src/components/endpoint-group.js
+++ b/docs/src/components/endpoint-group.js
@@ -32,7 +32,7 @@ export default class EndPointGroup extends Component {
entries.forEach((entry) => {
if (entry.isIntersecting) {
console.log(
- `EndPointGroup.entry.intersectionRatio: ${entry.intersectionRatio}`
+ `EndPointGroup.entry.intersectionRatio: ${entry.intersectionRatio}`,
);
const isAbove = entry.boundingClientRect.y < entry.rootBounds.y;
console.log(`isAbove ${isAbove}`);
@@ -41,7 +41,7 @@ export default class EndPointGroup extends Component {
if (entry.intersectionRatio >= 0.1) {
console.log(
- `EndPointGroup.onIntersection ${this.props.node.fieldValue}`
+ `EndPointGroup.onIntersection ${this.props.node.fieldValue}`,
);
this.props.onVisibleEndPointGroup(this.props.node.fieldValue);
}
diff --git a/docs/src/components/index-page.js b/docs/src/components/index-page.js
index 7b0c20e9..de21d437 100644
--- a/docs/src/components/index-page.js
+++ b/docs/src/components/index-page.js
@@ -76,7 +76,7 @@ export default class IndexPage extends Component {
- )
+ ),
)}
diff --git a/docs/src/components/search.js b/docs/src/components/search.js
index 51031d85..cd70348c 100644
--- a/docs/src/components/search.js
+++ b/docs/src/components/search.js
@@ -60,7 +60,7 @@ export default class Search extends Component {
diff --git a/docs/src/pages/api/00_usage.md b/docs/src/pages/api/00_usage.md
index cbf661c0..851f90f7 100644
--- a/docs/src/pages/api/00_usage.md
+++ b/docs/src/pages/api/00_usage.md
@@ -189,7 +189,7 @@ const myOctokit = new MyOctokit({
throttle: {
onRateLimit: (retryAfter, options) => {
myOctokit.log.warn(
- `Request quota exhausted for request ${options.method} ${options.url}`
+ `Request quota exhausted for request ${options.method} ${options.url}`,
);
if (options.request.retryCount === 0) {
@@ -201,7 +201,7 @@ const myOctokit = new MyOctokit({
onSecondaryRateLimit: (retryAfter, options, octokit) => {
// does not retry, only logs a warning
octokit.log.warn(
- `Secondary quota detected for request ${options.method} ${options.url}`
+ `Secondary quota detected for request ${options.method} ${options.url}`,
);
},
},
diff --git a/docs/src/pages/api/05_pagination.md b/docs/src/pages/api/05_pagination.md
index e1457572..12bb1515 100644
--- a/docs/src/pages/api/05_pagination.md
+++ b/docs/src/pages/api/05_pagination.md
@@ -27,7 +27,7 @@ octokit
.paginate(
"GET /repos/{owner}/{repo}/issues",
{ owner: "octokit", repo: "rest.js" },
- (response) => response.data.map((issue) => issue.title)
+ (response) => response.data.map((issue) => issue.title),
)
.then((issueTitles) => {
// issueTitles is now an array with the titles only
@@ -45,7 +45,7 @@ octokit.paginate(
done();
}
return response.data;
- }
+ },
);
```
@@ -70,7 +70,7 @@ for await (const response of octokit.paginate.iterator(
{
owner: "octokit",
repo: "rest.js",
- }
+ },
)) {
// do whatever you want with each response, break out of the loop, etc.
}
diff --git a/docs/src/pages/api/08_plugins.md b/docs/src/pages/api/08_plugins.md
index aac6e760..2b0a0b9a 100644
--- a/docs/src/pages/api/08_plugins.md
+++ b/docs/src/pages/api/08_plugins.md
@@ -9,7 +9,7 @@ You can customize and extend Octokit’s functionality using plugins
const { Octokit } = require("@octokit/rest");
const MyOctokit = Octokit.plugin(
require("./lib/my-plugin"),
- require("octokit-plugin-example")
+ require("octokit-plugin-example"),
);
// lib/my-plugin.js
@@ -21,7 +21,7 @@ module.exports = (octokit, options = { greeting: "Hello" }) => {
octokit.log.info(
`${options.method} ${options.url} – ${response.status} in ${
Date.now() - time
- }ms`
+ }ms`,
);
return response;
});
diff --git a/docs/src/pages/api/09_throttling.md b/docs/src/pages/api/09_throttling.md
index 36f7c0b2..b5c20dd4 100644
--- a/docs/src/pages/api/09_throttling.md
+++ b/docs/src/pages/api/09_throttling.md
@@ -20,7 +20,7 @@ const octokit = new MyOctokit({
throttle: {
onRateLimit: (retryAfter, options) => {
octokit.log.warn(
- `Request quota exhausted for request ${options.method} ${options.url}`
+ `Request quota exhausted for request ${options.method} ${options.url}`,
);
// Retry twice after hitting a rate limit error, then give up
@@ -32,7 +32,7 @@ const octokit = new MyOctokit({
onSecondaryRateLimit: (retryAfter, options, octokit) => {
// does not retry, only logs a warning
octokit.log.warn(
- `Secondary quota detected for request ${options.method} ${options.url}`
+ `Secondary quota detected for request ${options.method} ${options.url}`,
);
},
},
diff --git a/package-lock.json b/package-lock.json
index a2332eec..129fd5d6 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -26,7 +26,7 @@
"fetch-mock": "^9.0.0",
"glob": "^10.2.5",
"jest": "^29.0.0",
- "prettier": "2.8.8",
+ "prettier": "3.0.0",
"semantic-release": "^21.0.0",
"semantic-release-plugin-update-version-in-files": "^1.0.0",
"ts-jest": "^29.0.0",
@@ -11812,15 +11812,15 @@
}
},
"node_modules/prettier": {
- "version": "2.8.8",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
- "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz",
+ "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==",
"dev": true,
"bin": {
- "prettier": "bin-prettier.js"
+ "prettier": "bin/prettier.cjs"
},
"engines": {
- "node": ">=10.13.0"
+ "node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
@@ -22628,9 +22628,9 @@
}
},
"prettier": {
- "version": "2.8.8",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
- "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz",
+ "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==",
"dev": true
},
"pretty-format": {
diff --git a/package.json b/package.json
index 30736a8a..fc51f2ca 100644
--- a/package.json
+++ b/package.json
@@ -49,7 +49,7 @@
"fetch-mock": "^9.0.0",
"glob": "^10.2.5",
"jest": "^29.0.0",
- "prettier": "2.8.8",
+ "prettier": "3.0.0",
"semantic-release": "^21.0.0",
"semantic-release-plugin-update-version-in-files": "^1.0.0",
"ts-jest": "^29.0.0",
diff --git a/src/index.ts b/src/index.ts
index 0b558c0c..456089b4 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -9,7 +9,7 @@ import { VERSION } from "./version";
export const Octokit = Core.plugin(
requestLog,
legacyRestEndpointMethods,
- paginateRest
+ paginateRest,
).defaults({
userAgent: `octokit-rest.js/${VERSION}`,
});
diff --git a/test/integration/agent-ca/agent-ca-test.js b/test/integration/agent-ca/agent-ca-test.js
index 906c4ded..13cda3d8 100644
--- a/test/integration/agent-ca/agent-ca-test.js
+++ b/test/integration/agent-ca/agent-ca-test.js
@@ -22,7 +22,7 @@ describe("custom client certificate", () => {
response.writeHead(200);
response.write("ok");
response.end();
- }
+ },
);
server.listen(0, done);
diff --git a/test/integration/deprecations-test.js b/test/integration/deprecations-test.js
index d72ce4c4..59ef68da 100644
--- a/test/integration/deprecations-test.js
+++ b/test/integration/deprecations-test.js
@@ -135,7 +135,7 @@ describe("deprecations", () => {
});
expect(url).to.equal(
- "https://api.github.com/repos/octocat/hello-world/issues/123"
+ "https://api.github.com/repos/octocat/hello-world/issues/123",
);
expect(options.url).to.equal("/repos/{owner}/{repo}/issues/{issue_number}");
expect("number" in options).to.equal(false);
@@ -158,7 +158,7 @@ describe("deprecations", () => {
],
{
Link: '; rel="next", ; rel="last"',
- }
+ },
)
.get("/repositories/1/pulls/123/reviews")
@@ -179,7 +179,7 @@ describe("deprecations", () => {
},
{
Link: '; rel="first", ; rel="prev"',
- }
+ },
);
let warnCalledCount = 0;
@@ -252,7 +252,7 @@ describe("deprecations", () => {
{},
{
"x-github-otp": "required; app",
- }
+ },
);
nock("https://authentication-test-host.com", {
@@ -295,7 +295,7 @@ describe("deprecations", () => {
{},
{
"x-github-otp": "required; app",
- }
+ },
);
nock("https://authentication-test-host.com", {
@@ -338,7 +338,7 @@ describe("deprecations", () => {
{},
{
"x-github-otp": "required; app",
- }
+ },
);
nock("https://authentication-test-host.com", {
@@ -353,7 +353,7 @@ describe("deprecations", () => {
{},
{
"x-github-otp": "required; app",
- }
+ },
);
const octokit = new Octokit({
@@ -396,7 +396,7 @@ describe("deprecations", () => {
{},
{
"x-github-otp": "required; app",
- }
+ },
);
const octokit = new Octokit({
@@ -419,7 +419,7 @@ describe("deprecations", () => {
})
.catch((error) => {
expect(error.message).to.equal(
- "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication"
+ "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
);
expect(error.status).to.equal(401);
expect(!!error.response.headers).to.equal(true);
@@ -616,7 +616,7 @@ describe("deprecations", () => {
});
expect(warnCalledWith).to.match(
- /octokit\.authenticate\(\) is deprecated and has no effect/
+ /octokit\.authenticate\(\) is deprecated and has no effect/,
);
});
@@ -757,7 +757,7 @@ describe("deprecations", () => {
{},
{
"x-github-otp": "required; app",
- }
+ },
);
nock("https://authentication-test-host.com", {
@@ -795,7 +795,7 @@ describe("deprecations", () => {
{},
{
"x-github-otp": "required; app",
- }
+ },
);
nock("https://authentication-test-host.com", {
@@ -833,7 +833,7 @@ describe("deprecations", () => {
{},
{
"x-github-otp": "required; app",
- }
+ },
);
nock("https://authentication-test-host.com", {
@@ -848,7 +848,7 @@ describe("deprecations", () => {
{},
{
"x-github-otp": "required; app",
- }
+ },
);
const octokit = new Octokit({
@@ -886,7 +886,7 @@ describe("deprecations", () => {
{},
{
"x-github-otp": "required; app",
- }
+ },
);
nock("https://authentication-test-host.com", {
@@ -910,7 +910,7 @@ describe("deprecations", () => {
{},
{
"x-github-otp": "required; app",
- }
+ },
);
nock("https://authentication-test-host.com", {
@@ -954,7 +954,7 @@ describe("deprecations", () => {
{},
{
"x-github-otp": "required; app",
- }
+ },
);
const octokit = new Octokit({
@@ -974,7 +974,7 @@ describe("deprecations", () => {
.catch((error) => {
expect(error.message).to.equal(
- "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication"
+ "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
);
expect(error.status).to.equal(401);
expect(!!error.response.headers).to.equal(true);
@@ -1106,15 +1106,15 @@ describe("deprecations", () => {
return Promise.all([
octokit.request(
"GET /applications/{client_id}/tokens/{access_token}",
- options
+ options,
),
octokit.request(
"POST /applications/{client_id}/tokens/{access_token}",
- options
+ options,
),
octokit.request(
"DELETE /applications/{client_id}/tokens/{access_token}",
- options
+ options,
),
]);
});
@@ -1143,7 +1143,7 @@ describe("deprecations", () => {
reqheaders: {
authorization: "token abc4567",
},
- }
+ },
)
.get("/")
.reply(200, {});
@@ -1269,7 +1269,7 @@ describe("deprecations", () => {
octokit.hook.wrap("request", (request, options) => {
expect(options.headers["user-agent"]).to.match(
- /^blah octokit\.js\/0\.0\.0-development /
+ /^blah octokit\.js\/0\.0\.0-development /,
);
return "ok";
});
@@ -1297,7 +1297,7 @@ describe("deprecations", () => {
octokit.hook.wrap("request", (request, options) => {
expect(options.headers.accept).to.equal(
- "application/vnd.github.jean-grey-preview+json,application/vnd.github.symmetra-preview+json"
+ "application/vnd.github.jean-grey-preview+json,application/vnd.github.symmetra-preview+json",
);
return "ok";
});
@@ -1329,7 +1329,7 @@ describe("deprecations", () => {
},
{
Link: '; rel="next", ; rel="last"',
- }
+ },
)
.get("/installation/repositories")
@@ -1350,7 +1350,7 @@ describe("deprecations", () => {
},
{
Link: '; rel="first", ; rel="prev"',
- }
+ },
)
.get("/search/issues")
@@ -1371,7 +1371,7 @@ describe("deprecations", () => {
},
{
Link: '; rel="next", ; rel="last"',
- }
+ },
)
.get("/search/issues")
@@ -1393,7 +1393,7 @@ describe("deprecations", () => {
},
{
Link: '; rel="first", ; rel="prev"',
- }
+ },
);
let warnCallCount = 0;
@@ -1431,7 +1431,7 @@ describe("deprecations", () => {
expect(result.data.total_count).to.equal(2);
expect(result.data.items.length).to.equal(1);
return result;
- })
+ }),
)
.then(() => {
diff --git a/test/integration/pagination-test.js b/test/integration/pagination-test.js
index b6d6bce9..3e7b8b11 100644
--- a/test/integration/pagination-test.js
+++ b/test/integration/pagination-test.js
@@ -30,7 +30,7 @@ describe("pagination", () => {
}),
octokit
.paginate("GET /organizations", { per_page: 1 }, (response) =>
- response.data.map((org) => org.id)
+ response.data.map((org) => org.id),
)
.then((organizations) => {
expect(organizations).to.deep.equal([1, 2]);
@@ -42,7 +42,7 @@ describe("pagination", () => {
url: "/organizations",
per_page: 1,
},
- (response) => response.data.map((org) => org.id)
+ (response) => response.data.map((org) => org.id),
)
.then((organizations) => {
expect(organizations).to.deep.equal([1, 2]);
@@ -202,7 +202,7 @@ describe("pagination", () => {
},
{
Link: '; rel="next", ; rel="last"',
- }
+ },
)
.get("/search/issues")
@@ -224,7 +224,7 @@ describe("pagination", () => {
},
{
Link: '; rel="prev", ; rel="first"',
- }
+ },
);
const octokit = new Octokit();
@@ -259,7 +259,7 @@ describe("pagination", () => {
},
{
Link: '; rel="next", ; rel="last"',
- }
+ },
)
.get("/installation/repositories")
@@ -280,7 +280,7 @@ describe("pagination", () => {
},
{
Link: '; rel="prev", ; rel="first"',
- }
+ },
);
const octokit = new Octokit();
@@ -311,7 +311,7 @@ describe("pagination", () => {
},
{
Link: '; rel="next", ; rel="last"',
- }
+ },
)
.get("/user/installations")
@@ -331,7 +331,7 @@ describe("pagination", () => {
},
{
Link: '; rel="prev", ; rel="first"',
- }
+ },
);
const octokit = new Octokit();
diff --git a/test/integration/params-validations-test.js b/test/integration/params-validations-test.js
index 112b2f76..e86faa7a 100644
--- a/test/integration/params-validations-test.js
+++ b/test/integration/params-validations-test.js
@@ -17,7 +17,7 @@ describe("params validations", () => {
.catch((error) => {
expect(error.message).to.equal(
- "Empty value for parameter 'org': undefined"
+ "Empty value for parameter 'org': undefined",
);
expect(error.status).to.equal(400);
});
@@ -38,7 +38,7 @@ describe("params validations", () => {
.catch((error) => {
expect(error.status).to.equal(500);
expect(error.message).to.equal(
- "request to https://127.0.0.1:8/orgs/foo failed, reason: connect ECONNREFUSED 127.0.0.1:8"
+ "request to https://127.0.0.1:8/orgs/foo failed, reason: connect ECONNREFUSED 127.0.0.1:8",
);
});
});
@@ -56,7 +56,7 @@ describe("params validations", () => {
.catch((error) => {
expect(error.status).to.equal(400);
expect(error.message).to.equal(
- "Invalid value for parameter 'filter': \"foo\""
+ "Invalid value for parameter 'filter': \"foo\"",
);
});
});
@@ -74,7 +74,7 @@ describe("params validations", () => {
.catch((error) => {
expect(error.status).to.equal(400);
expect(error.message).to.equal(
- "Invalid value for parameter 'position': \"foo\""
+ "Invalid value for parameter 'position': \"foo\"",
);
});
});
@@ -94,7 +94,7 @@ describe("params validations", () => {
.catch((error) => {
expect(error.status).to.equal(400);
expect(error.message).to.equal(
- "Invalid value for parameter 'position': \"Age Ain’t Nothing\" is NaN"
+ "Invalid value for parameter 'position': \"Age Ain’t Nothing\" is NaN",
);
});
});
@@ -117,7 +117,7 @@ describe("params validations", () => {
.catch((error) => {
expect(error.status).to.equal(400);
expect(error.message).to.equal(
- "JSON parse error of value for parameter 'config': \"I’m no Je-Son!\""
+ "JSON parse error of value for parameter 'config': \"I’m no Je-Son!\"",
);
});
});
@@ -183,7 +183,7 @@ describe("params validations", () => {
.catch((error) => {
expect(error.status).to.equal(400);
expect(error.message).to.equal(
- "Invalid value for parameter 'tree[0].type': \"foo\""
+ "Invalid value for parameter 'tree[0].type': \"foo\"",
);
});
});
diff --git a/test/integration/request-errors-test.js b/test/integration/request-errors-test.js
index c3122c0f..a57a2c8f 100644
--- a/test/integration/request-errors-test.js
+++ b/test/integration/request-errors-test.js
@@ -90,7 +90,7 @@ describe("request errors", () => {
{},
{
"x-foo": "bar",
- }
+ },
);
const octokit = new Octokit({
@@ -123,7 +123,7 @@ describe("request errors", () => {
.catch((error) => {
expect(error.request.headers.authorization).to.equal(
- "token [REDACTED]"
+ "token [REDACTED]",
);
});
});
diff --git a/test/integration/smoke.test.ts b/test/integration/smoke.test.ts
index 9641599a..96a597ea 100644
--- a/test/integration/smoke.test.ts
+++ b/test/integration/smoke.test.ts
@@ -95,7 +95,7 @@ describe("Smoke tests", () => {
expect(consoleStub.info.mock.calls.length).toEqual(2);
expect(consoleStub.warn.mock.calls.length).toEqual(0);
expect(consoleStub.error.mock.calls.length).toEqual(0);
- }
+ },
);
});
});
diff --git a/test/issues/1279-store-otp-send-header-all-requests-test.js b/test/issues/1279-store-otp-send-header-all-requests-test.js
index 5bac1960..0793d3da 100644
--- a/test/issues/1279-store-otp-send-header-all-requests-test.js
+++ b/test/issues/1279-store-otp-send-header-all-requests-test.js
@@ -16,7 +16,7 @@ describe("https://github.com/octokit/rest.js/issues/1279", () => {
{},
{
"x-github-otp": "required; app",
- }
+ },
);
nock("https://authentication-test-host.com", {
@@ -65,7 +65,7 @@ describe("https://github.com/octokit/rest.js/issues/1279", () => {
{},
{
"x-github-otp": "required; app",
- }
+ },
);
nock("https://authentication-test-host.com", {
@@ -90,7 +90,7 @@ describe("https://github.com/octokit/rest.js/issues/1279", () => {
{},
{
"x-github-otp": "required; app",
- }
+ },
);
nock("https://authentication-test-host.com", {
diff --git a/test/issues/1497-include-error-message-on-validation-error-test.js b/test/issues/1497-include-error-message-on-validation-error-test.js
index 5692de90..fc787030 100644
--- a/test/issues/1497-include-error-message-on-validation-error-test.js
+++ b/test/issues/1497-include-error-message-on-validation-error-test.js
@@ -58,7 +58,7 @@ describe("https://github.com/octokit/rest.js/issues/1497", () => {
.catch((error) => {
expect(error).to.have.property(
"message",
- `Validation Failed: "Only organization repositories can have users and team restrictions"`
+ `Validation Failed: "Only organization repositories can have users and team restrictions"`,
);
});
});
diff --git a/test/issues/1553-deprecated-teams-methods-test.js b/test/issues/1553-deprecated-teams-methods-test.js
index 0b950f18..0e61dd70 100644
--- a/test/issues/1553-deprecated-teams-methods-test.js
+++ b/test/issues/1553-deprecated-teams-methods-test.js
@@ -23,7 +23,7 @@ describe("https://github.com/octokit/rest.js/issues/1553", () => {
it.skip("octokit.rest.teams.listMembersLegacy.endpoint()", () => {
const octokit = new Octokit();
expect(typeof octokit.rest.teams.listMembersLegacy.endpoint).to.equal(
- "function"
+ "function",
);
});
});
diff --git a/test/issues/881-redirect-url.test.ts b/test/issues/881-redirect-url.test.ts
index 829b4a68..a65ed81c 100644
--- a/test/issues/881-redirect-url.test.ts
+++ b/test/issues/881-redirect-url.test.ts
@@ -13,7 +13,7 @@ describe("https://github.com/octokit/rest.js/issues/881", () => {
"https://api.github.com/repos/octocat/Hello-World/tarball/master",
{
redirectUrl: REDIRECT_URL,
- }
+ },
)
.headOnce(REDIRECT_URL, 200);
@@ -34,7 +34,7 @@ describe("https://github.com/octokit/rest.js/issues/881", () => {
.then((response) => {
// @ts-ignore https://github.com/octokit/types.ts/issues/211
expect(response.url).toEqual(
- "https://issue-881-codeload.github.com/octocat/Hello-World/legacy.tar.gz/master"
+ "https://issue-881-codeload.github.com/octocat/Hello-World/legacy.tar.gz/master",
);
});
});
diff --git a/test/scenarios/add-and-remove-repository-collaborator.test.ts b/test/scenarios/add-and-remove-repository-collaborator.test.ts
index 451db872..071a7c35 100644
--- a/test/scenarios/add-and-remove-repository-collaborator.test.ts
+++ b/test/scenarios/add-and-remove-repository-collaborator.test.ts
@@ -13,7 +13,7 @@ describe("api.github.com", () => {
githubUserB = fixtureToInstance(fixture, {
auth: "token 0000000000000000000000000000000000000002",
});
- }
+ },
);
});
it("add-and-remove-repository-collaborator-test", () => {
diff --git a/test/scenarios/errors.test.ts b/test/scenarios/errors.test.ts
index a382ad01..7d5ec7c4 100644
--- a/test/scenarios/errors.test.ts
+++ b/test/scenarios/errors.test.ts
@@ -22,7 +22,7 @@ describe("api.github.com", () => {
.catch((error) => {
expect(error.message).toEqual(
- `Validation Failed: {"resource":"Label","code":"invalid","field":"color"}`
+ `Validation Failed: {"resource":"Label","code":"invalid","field":"color"}`,
);
expect(error.response.data.errors).toStrictEqual([
{
@@ -32,7 +32,7 @@ describe("api.github.com", () => {
},
]);
expect(error.response.data.documentation_url).toMatch(
- new RegExp("rest/reference/issues#create-a-label")
+ new RegExp("rest/reference/issues#create-a-label"),
);
});
});
diff --git a/test/scenarios/markdown.test.ts b/test/scenarios/markdown.test.ts
index 913e71b4..f5cbca79 100644
--- a/test/scenarios/markdown.test.ts
+++ b/test/scenarios/markdown.test.ts
@@ -27,7 +27,7 @@ b597b5d`,
.then((response) => {
expect(response.data).toMatch(/Hello<\/h3>/);
expect(response.data).toMatch(
- /\/octokit-fixture-org\/hello-world\/commit\/b597b5d6eead8f1a9e9d3243cd70a890a6155ca8/
+ /\/octokit-fixture-org\/hello-world\/commit\/b597b5d6eead8f1a9e9d3243cd70a890a6155ca8/,
);
expect(response.data).toMatch(/b597b5d<\/tt>/);
@@ -59,7 +59,7 @@ b597b5d`,
.then((response) => {
expect(response.data).toMatch(/Hello<\/h3>/);
expect(response.data).toMatch(
- /\/octokit-fixture-org\/hello-world\/commit\/b597b5d6eead8f1a9e9d3243cd70a890a6155ca8/
+ /\/octokit-fixture-org\/hello-world\/commit\/b597b5d6eead8f1a9e9d3243cd70a890a6155ca8/,
);
expect(response.data).toMatch(/b597b5d<\/tt>/);
});
diff --git a/test/scenarios/paginate-issues-async-await.test.ts b/test/scenarios/paginate-issues-async-await.test.ts
index ce344f45..2f63f8ae 100644
--- a/test/scenarios/paginate-issues-async-await.test.ts
+++ b/test/scenarios/paginate-issues-async-await.test.ts
@@ -26,7 +26,7 @@ describe("api.github.com", () => {
const results = [];
for await (const result of octokit.paginate.iterator(
// @ts-ignore TODO: *.endpoint.merge on endpoint methods should always return .url property
- octokit.rest.issues.listForRepo.endpoint.merge(options)
+ octokit.rest.issues.listForRepo.endpoint.merge(options),
)) {
results.push(...result.data);
}
diff --git a/test/typescript-validate.ts b/test/typescript-validate.ts
index 3d749bdc..10a163dc 100644
--- a/test/typescript-validate.ts
+++ b/test/typescript-validate.ts
@@ -46,7 +46,7 @@ export default async function () {
const userIssuesResponse = await octokit.rest.issues.listForAuthenticatedUser(
{
state: "open",
- }
+ },
);
userIssuesResponse.data[0].locked;
@@ -96,7 +96,7 @@ export default async function () {
console.log(`${options.method} ${options.url}: ${response.status}`);
});
- const findInCache = (etag: string) => ({} as EndpointDefaults);
+ const findInCache = (etag: string) => ({}) as EndpointDefaults;
octokit.hook.error("request", async (error, options) => {
if ("status" in error && error.status === 304) {
@@ -152,7 +152,7 @@ export default async function () {
.paginate(
"GET /repos/{owner}/{repo}/labels",
{ owner: "octokit", repo: "rest.js" },
- (response) => response.data.map((label) => label.name)
+ (response) => response.data.map((label) => label.name),
)
.then((labelNames) => {
// labelNames is now an array with the names only
@@ -163,7 +163,7 @@ export default async function () {
repo: "rest.js",
});
for await (const response of octokit.paginate.iterator<{ id: number }>(
- options
+ options,
)) {
// do whatever you want with each response, break out of the loop, etc.
console.log(response.data.map((repo) => repo.id));
@@ -177,7 +177,7 @@ export default async function () {
console.log(
`${options.method} ${options.url} – ${response.status} in ${
Date.now() - time
- }ms`
+ }ms`,
);
return response;
});
@@ -218,7 +218,7 @@ export default async function () {
console.log(data.color);
async function updateLabel(
- options: RestEndpointMethodTypes["issues"]["updateLabel"]["parameters"]
+ options: RestEndpointMethodTypes["issues"]["updateLabel"]["parameters"],
): Promise {
console.log(options);
diff --git a/test/util.ts b/test/util.ts
index 36148fd1..317d2d5f 100644
--- a/test/util.ts
+++ b/test/util.ts
@@ -25,7 +25,7 @@ export function loadFixture(scenario: string) {
.catch((error) => {
if (error.status === "ECONNREFUSED") {
throw new Error(
- 'Fixtures server could not be reached. Make sure to start it with "npm run start-fixtures-server"'
+ 'Fixtures server could not be reached. Make sure to start it with "npm run start-fixtures-server"',
);
}
@@ -35,17 +35,17 @@ export function loadFixture(scenario: string) {
export function fixtureToInstance(
{ url }: OptionsWithUrl,
- options?: OctokitOptions
+ options?: OctokitOptions,
) {
return new Octokit(
Object.assign(options || {}, {
baseUrl: url,
- })
+ }),
);
}
export function getInstance(scenario: string, options?: OctokitOptions) {
return loadFixture(scenario).then((fixture) =>
- fixtureToInstance(fixture, options)
+ fixtureToInstance(fixture, options),
);
}