Skip to content
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

[while running Jest tests] ReferenceError: fetch is not defined #4

Open
ghost opened this issue Feb 27, 2020 · 2 comments
Open

[while running Jest tests] ReferenceError: fetch is not defined #4

ghost opened this issue Feb 27, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 27, 2020

I'm using this package in my Expo/React Native app and when I try to run my front-end unit tests, the Jest runner fails before it even gets to my actual tests.

The runner is saying that fetch is undefined in the ._pushEvent method.

return fetch(MIXPANEL_API_URL + "/track/?data=" + buffer);

I'm able to resolve this by importing another package (import fetch from 'jest-fetch-mock') into each of my test files. But I was wondering if there was a way that this could be resolved within your package itself?

If it's something that I could help out with by doing a PR, I'd be happy to do so. :-)

Please let me know if you have any questions. Thanks!

@benawad
Copy link
Owner

benawad commented Feb 28, 2020

I'm not using this package anymore, but PRs are welcome

@SirPhemmiey
Copy link

Hi @benawad , what package are you using now for expo mixpanel?

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

No branches or pull requests

2 participants