Skip to content

Conversation

@alexandre-abrioux
Copy link

@alexandre-abrioux alexandre-abrioux commented Nov 7, 2025

Motivation and Resolution

When running tests with Jest using testEnvironment: "jsdom" to simulate a browser environment, globalThis is defined but globalThis.fetch is removed by Jest.

When using Starknet's Javascript library, we end up with the following error in tests:

TypeError: Cannot read properties of undefined (reading 'bind')

This is a fix to remediate that issue.

Usage related changes

N/A

Development related changes

N/A

Checklist:

  • Performed a self-review of the code
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Linked the issues which this PR resolves
  • Documented the changes in code (API docs will be generated automatically)
  • Updated the tests
  • All tests are passing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant