Open AchoArnold opened 4 years ago
Hello,
When I try to test a mapbox componet with jest, I get the error Error in mounted hook: "ReferenceError: mapboxgl is not defined"
jest
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: () => ({}), }));
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 work