-
-
Notifications
You must be signed in to change notification settings - Fork 137
window.URL.createObjectURL jest fail #115
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
Comments
Thank you for reporting this issue. @juliehubs You're right that the problem lies in mapbox. Did you try mocking the function as suggested in the following comment mapbox/mapbox-gl-js#3436 (comment)? |
@antoinerg I tried adding that in my test, didn't seem to work, but I am probably doing something wrong to be honest. |
I added to my test and also install jest-canvas-mock, this works form me |
What am I doing wrong?! I feel so confused! @GamalielCrdz
|
@juliehubs in my case, I added the follow line |
That did it as well as your tip to add jest-canvas-mock! Thanks so much! |
Thank you @GamalielCrdz! |
All precisions here hustcc/jest-canvas-mock#2 The tests are passing, but the error is logged due to a jsdom peculiarity on the As I do not need to test (Trying to install canvas or canvas-prebuilt lead to installation errors) |
If you come here from Vue, I solve this from your solution doing this:
Hope to helps someone. |
When running a jest test, you will receive an error that window.URL.createObjectURL is not a function.
Any ideas of a way to fix this?
I have tried mocking it in jest, as I have found that this is supposedly a mapbox issue, but none of those solutions seem to work.
The text was updated successfully, but these errors were encountered: