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

Unit testing #210

Closed
jenyeeiam opened this issue Apr 26, 2017 · 4 comments
Closed

Unit testing #210

jenyeeiam opened this issue Apr 26, 2017 · 4 comments

Comments

@jenyeeiam
Copy link

Anyone else unable to run their unit tests on and receive this error?

TypeError: window.URL.createObjectURL is not a function

  at Object.193.../../source/worker (node_modules/react-mapbox-gl/node_modules/mapbox-gl/dist/mapbox-gl.js:396:100)
  at s (node_modules/react-mapbox-gl/node_modules/mapbox-gl/dist/mapbox-gl.js:1:711)
@abmai
Copy link
Contributor

abmai commented Jun 12, 2017

@jenyeeiam sorry for the late response here. Was this on master? Which version of Node were you using?

@jenyeeiam
Copy link
Author

No worries I resolved my problem, I found a way to mock the mapbox-gl library in my tests. Thanks anyways!

@weisssean
Copy link

@jenyeeiam Can you share your code?

@jenyeeiam
Copy link
Author

It's been a while, but here's the snippet of code I used to mock the mapbox-gl library

jest.mock('mapbox-gl/dist/mapbox-gl', () => ({
Map: () => ({})
}));

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

3 participants