We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
any unit test for a file that has "import mapboxgl from "mapbox-gl"" at the top fails with "TextDecoder is not defined"
mapbox-gl-js version: ^3.0.1
browser: n/a
The text was updated successfully, but these errors were encountered:
Possibly caused by jsdom/jsdom#2524?
We hit a simlar issue and jsdom/jsdom#2524 (comment) solved it for us in a jest setup file:
import * as util from 'util' // ref: https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom // ref: https://github.com/jsdom/jsdom/issues/2524 Object.defineProperty(window, 'TextEncoder', { writable: true, value: util.TextEncoder }) Object.defineProperty(window, 'TextDecoder', { writable: true, value: util.TextDecoder })
Sorry, something went wrong.
Thanks Matt, I'll give that a go at some point today and reply here to let you know if it resovled my issue
@mattdean-digicatapult beautiful, that did the trick. Thanks! This can be closed
No branches or pull requests
any unit test for a file that has "import mapboxgl from "mapbox-gl"" at the top fails with "TextDecoder is not defined"
mapbox-gl-js version: ^3.0.1
browser: n/a
The text was updated successfully, but these errors were encountered: