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)
@jenyeeiam sorry for the late response here. Was this on master? Which version of Node were you using?
No worries I resolved my problem, I found a way to mock the mapbox-gl library in my tests. Thanks anyways!
@jenyeeiam Can you share your code?
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: () => ({})
}));
Most helpful comment
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: () => ({})
}));