Hi, I'm trying to encapsulate Matomo in jest mocking for my unit test. Everything worked well with useMatomo but as soon as it goes to newMatomoTracker everything goes wrong.
Following the readme, here's my implementation in my app.tsx :
const instance = new MatomoTracker({
urlBase: MATOMO_URL as string,
siteId: MATOMO_SITE_ID as number,
userId: hash(id),
disabled: !MATOMO_TRACKING_ENABLED,
log: false,
});
Hi, I'm trying to encapsulate Matomo in jest mocking for my unit test. Everything worked well with useMatomo but as soon as it goes to newMatomoTracker everything goes wrong. Following the readme, here's my implementation in my app.tsx :
And my react-native-mock :
I've tried both default / define MatomoTracker but I end up with the same error : TypeError: _matomoTrackerReactNative.default is not a constructor
If you have any idea about how to fix it Thanks