When running my test using Jest and Enzyme, I get this error:
● Test suite failed to run
TypeError: Cannot read property 'sharedInstanceWithToken' of undefined
47 | class MixPanelClient {
48 | constructor() {
> 49 | Mixpanel.default.sharedInstanceWithToken(
| ^
50 | this.getProjectToken(),
51 | false,
52 | true,
at new MixPanelClient (src/services/utility/MixPanelClient.ts:49:22)
at Object.<anonymous> (src/services/utility/MixPanelClient.ts:107:16)
at Object.<anonymous> (__tests__/bootstrapTests.ts:1:1)
In my jest setup, the mocking did not solve this issue:
When running my test using Jest and Enzyme, I get this error:
In my jest setup, the mocking did not solve this issue: