-
Notifications
You must be signed in to change notification settings - Fork 310
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
feat: v5 #563
feat: v5 #563
Changes from all commits
11d6862
41cbcdc
0122b69
819646a
6fb43c4
5dca843
5a5776d
7627a33
db76bdb
d267580
5f043aa
6ce4d38
4311080
6aeab0a
4fa71b4
8b0dc00
1c89fd5
d5e1222
fcb43d3
61e4c36
d4b89b7
2ffb8a3
a2aa1f3
260568f
57a7303
4e934d2
6974fd6
29f04aa
e91e8a4
71ca7a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,23 +24,25 @@ | |
"author": "Gregor Martynus (https://github.com/gr2m)", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@octokit/auth-token": "^3.0.0", | ||
"@octokit/graphql": "^5.0.0", | ||
"@octokit/request": "^6.0.0", | ||
"@octokit/request-error": "^3.0.0", | ||
"@octokit/types": "^9.0.0", | ||
"@octokit/auth-token": "^4.0.0", | ||
"@octokit/graphql": "^7.0.0", | ||
"@octokit/request": "^8.0.2", | ||
"@octokit/request-error": "^5.0.0", | ||
"@octokit/types": "^11.0.0", | ||
"before-after-hook": "^2.2.0", | ||
"universal-user-agent": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"@octokit/auth": "^3.0.1", | ||
"@octokit/auth-action": "^4.0.0", | ||
"@octokit/auth-app": "^6.0.0", | ||
"@octokit/auth-oauth-app": "^7.0.0", | ||
"@octokit/tsconfig": "^2.0.0", | ||
"@types/fetch-mock": "^7.3.1", | ||
"@types/jest": "^29.0.0", | ||
"@types/lolex": "^5.1.0", | ||
"@types/node": "^18.0.0", | ||
"esbuild": "^0.18.0", | ||
"fetch-mock": "^9.0.0", | ||
"fetch-mock": "npm:@gr2m/[email protected]", | ||
"glob": "^10.2.5", | ||
"http-proxy-agent": "^7.0.0", | ||
"jest": "^29.0.0", | ||
|
@@ -103,6 +105,6 @@ | |
] | ||
}, | ||
"engines": { | ||
"node": ">= 14" | ||
"node": ">= 18" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ import fetchMock from "fetch-mock"; | |
describe("Smoke test", () => { | ||
it("previews option", () => { | ||
const mock = fetchMock.sandbox().getOnce( | ||
"https://api.github.com/", | ||
"https://api.github.com/graphql", | ||
Comment on lines
6
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we update the test to something real? At least we should use |
||
{ ok: true }, | ||
{ | ||
headers: { | ||
|
@@ -25,7 +25,7 @@ describe("Smoke test", () => { | |
}, | ||
}); | ||
|
||
return octokit.request("/"); | ||
return octokit.request("/graphql"); | ||
}); | ||
|
||
it("timeZone option", () => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,40 +98,41 @@ describe("octokit.request()", () => { | |
const mock = fetchMock | ||
.sandbox() | ||
.getOnce( | ||
"https://api.github.com/", | ||
"https://api.github.com/graphql", | ||
Comment on lines
100
to
+101
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above, let's use |
||
{}, | ||
{ | ||
headers: { | ||
accept: | ||
"application/vnd.github.foo-preview+json,application/vnd.github.bar-preview+json", | ||
accept: "application/vnd.github.package-deletes-preview.json", | ||
"user-agent": userAgent, | ||
}, | ||
}, | ||
) | ||
.getOnce( | ||
"https://api.github.com/", | ||
"https://api.github.com/graphql", | ||
{}, | ||
{ | ||
headers: { | ||
accept: | ||
"application/vnd.github.foo-preview.raw,application/vnd.github.bar-preview.raw,application/vnd.github.baz-preview.raw", | ||
accept: "application/vnd.github.v3.raw", | ||
"user-agent": userAgent, | ||
}, | ||
overwriteRoutes: false, | ||
}, | ||
); | ||
|
||
const octokit = new Octokit({ | ||
previews: ["foo", "bar-preview"], | ||
request: { | ||
fetch: mock, | ||
}, | ||
}); | ||
|
||
await octokit.request("/"); | ||
await octokit.request("/", { | ||
await octokit.request("/graphql", { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thinking more about it, maybe we should move these tests to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll look into hoisting them out once I get past the skips. We could also differ it to another change set so we can move forward here. Not like the change would be hard, it just introduces more into something we've been trying to get out the door. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agree, this can totally be a follow up, like all of my comments |
||
mediaType: { | ||
previews: ["package-deletes"], | ||
format: "json", | ||
}, | ||
}); | ||
await octokit.request("/graphql", { | ||
mediaType: { | ||
previews: ["bar", "baz-preview"], | ||
format: "raw", | ||
}, | ||
}); | ||
|
@@ -178,6 +179,7 @@ describe("octokit.request()", () => { | |
{ | ||
owner: "epmatsw", | ||
repo: "example-repo", | ||
// @ts-expect-error There is currently an issue with the types, null is an allowed value | ||
milestone: null, | ||
issue_number: 1, | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to see this get merged into fetch-mock - any thoughts on what might be holding that up (since Sept 2022)?
The alias is fine, but it does seem like the project isn't even in maintenance mode - given the last commit to master was almost 2 years ago. Are there any alternatives to this mocking framework that would make for an easy migration and get us the functionality that we need here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know of any alternatives at the moment.