-
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
[BUG]: can not intercept requests with nock #551
Labels
Type: Support
Any questions, information, or general needs around the SDK or GitHub APIs
Comments
mac2000
added
Status: Triage
This is being looked at and prioritized
Type: Bug
Something isn't working as documented
labels
Feb 24, 2023
The latest Node comes with a built-in I would recommend to mock with Lines 15 to 28 in 72c8bc7
|
gr2m
added
Type: Support
Any questions, information, or general needs around the SDK or GitHub APIs
and removed
Type: Bug
Something isn't working as documented
labels
Feb 24, 2023
Closing as the question has been answered. Please open additional issue(s) for additional questions. |
github-project-automation
bot
moved this from 🛑 Blocked/Awaiting Response
to ✅ Done
in 🧰 Octokit Active
Oct 17, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
Suddenly all tests depending on nock starts to fail
mkdir foo cd foo npm init -y -f npm i -S @octokit/rest nock
demo.js
Instead of expected, mocked response I'm receiving and error "This endpoint requires you to be authenticated"
Which makes me believe tests like this 1323-parameter-deprecation-bug-test.js will also fail
Meanwhile, node complains:
When enabling trace warning as node suggests I see this piece of code in @octokit/request.js:
and indeed if I will put nodeFetch in first place, suddenly everything starts to work
current workaround is already suggested somewhere in stackoverflow
so we may want to do something like this (note that request.js library depends on node-fetch):
Versions
"@octokit/rest": "^19.0.7"
"nock": "^13.3.0"
node: v18.5.0
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: