-
Notifications
You must be signed in to change notification settings - Fork 832
fix(utils): fetch bindings #1514
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
Conversation
|
This would produce an issue if globalThis, window, global are unreferenced. typeof a?.fetch
VM6129:1 Uncaught ReferenceError: a is not defined
at <anonymous>:1:1On the other hand, for unreferenced elements, this is fine fetch is a known issue with jsdom, and is not the best solution for testing. There are multiple issues and references to using a headless browser rather than it. |
|
@tabaktoni Thanks for reviewing this PR! And I apologize for my mistake; I should have tested this further. I agree that The goal of this PR was to contribute a general fix that would prevent it from happening to someone else. I updated the condition, and it should now work for all cases. Let me know what you think! |
|
Thanks for the approval @penovicp! The CI is failing, but I don't see any failed tests. Please let me know if there is anything I can do to help with the merge. |
## [9.1.1](v9.1.0...v9.1.1) (2025-12-09) ### Bug Fixes * **utils:** fetch bindings ([#1514](#1514)) ([45e063b](45e063b))
|
🎉 This PR is included in version 9.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Motivation and Resolution
When running tests with Jest using
testEnvironment: "jsdom"to simulate a browser environment,globalThisis defined butglobalThis.fetchis removed by Jest.When using Starknet's Javascript library, we end up with the following error in tests:
This is a fix to remediate that issue.
Usage related changes
N/A
Development related changes
N/A
Checklist: