-
Notifications
You must be signed in to change notification settings - Fork 1
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
Is jest-polly compatible with Node 18.3+ fetch #342
Comments
I am not sure, have not tested. Ultimately, this package uses This package does not use |
Added Node 18 to the test matrix - tests pass! Closing the issue, but feel free to reopen it or leave your feedback here if something is not working. |
Thanks for the reply @moltar I just looked at your Add Node 18 to tests commit and see that this is testing What I'm talking about here is that $ nvm use 18
Now using node v18.12.1 (npm v8.19.2)
$ node
Welcome to Node.js v18.12.1.
Type ".help" for more information.
> fetch
[AsyncFunction: fetch]
$ nvm use 16
Now using node v16.18.1 (npm v8.19.2)
$ node
Welcome to Node.js v16.18.1.
Type ".help" for more information.
> fetch
Uncaught ReferenceError: fetch is not defined PollyJS have a Fetch Adapter that has the byline:
And this is different to their HTTP Adapter which is what this module is using. I'm wondering if there need to be 2 distinct |
Understood! In that case it doesn't seem to be working. The issue appears to be in the adapter. But I didn't really spend too much time on this. See the PR linked above. I think if the adapter can be made to work, then on this end, we should just either make the adapter configurable. Or not set it at all, since it can be set via a global Polly singleton anyways. |
For now, I do not have more bandwidth to dig further at the moment. If you want to propose a fix, I will make sure to review & merge it in a timely manner. |
I just read your note in the PR and you are running into the same issue I was seeing. It looks like you've tracked down why this is happening and relates to Is there a way that we can mark this issue as blocked by nock/nock#2397 ? That way perhaps there'll be a notification when that's resolved and we can do an update request to PollyJS... In the meantime I think we just leave this open for others like me to see. |
stumbling in the same issue :) |
From Node 18.3+ onward native fetch is available on the global object. Does
jest-polly
work with this?The text was updated successfully, but these errors were encountered: