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
jest
Hello,
When I try to test a mapbox componet with jest, I get the error Error in mounted hook: "ReferenceError: mapboxgl is not defined"
Error in mounted hook: "ReferenceError: mapboxgl is not defined"
I've tried changing my jest config to
module.exports = { moduleNameMapper: { '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/.jest/fileMock.js', mapboxgl: '<rootDir>/node_modules/mapbox-gl/dist/mapbox-gl.js', }, };
and even adding a jest mock but I can't get it to work
jest.mock('mapboxgl', () => ({ Map: () => ({}), }));
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
When I try to test a mapbox componet with
jest
, I get the errorError in mounted hook: "ReferenceError: mapboxgl is not defined"
I've tried changing my jest config to
and even adding a
jest
mock but I can't get it to workThe text was updated successfully, but these errors were encountered: