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
Testing Using Nock does not work #1977
Comments
Thanks for opening this issue. A contributor should be by to give feedback soon. In the meantime, please check out the contributing guidelines and explore other ways you can get involved. |
use nock 14 beta, which should work with native fetch. |
I figured that out while writing this bug, but it would be nice to have it documented somewhere. Maybe I should have put this in the doc's repo, but since it also applies to the |
PRs are welcome. But somehow it feels wrong to document it now. If nock 14 becomes stable I would say yes. |
|
You can use |
Bug Report
It looks like in v8 of @octokit/requests, they switched from using Node's HTTP api, to using
fetch
. The latest publishednock
does not have support forfetch
, so it does not catch the requests.Current Behavior
As described in documentation and set up by
create-probot-app
, usingnock
does not intercept requests.API requests get through and fail because of invalid keys, tokens, or installation IDs
Expected behavior/code
Documented examples of testing should work and not let requests through.
Environment
Possible Solution
nock
does not currently work. Updatecreate-probot-app
to includenock@beta
-- or --
options.request.fetch
option with a custom mock function in@octokit/request
The text was updated successfully, but these errors were encountered: