Closed southerneer closed 4 years ago
LGTM, merging
Alternatively, if we want to preserve the rn-chat/wocky-client separation, we can declare persistLog and notifyBugsnag as global functions (and stub them out in testuser.ts)
Creating new globals should be avoided as a general rule. It's difficult to be certain when they are available to be called and they can cause memory leaks since they are never garbage collected.
Interesting.
1.
This PR breaks the rn-chat/wocky-client separation. Hence, I think we should decide on #4888 first (or at least, @aksonov to have a look) before deciding on this.
But if we choose to break the separation, then this PR is in the right direction.
2.
jest.mock
is interesting and looks useful. Thanks. I didn't know about it.3.
Alternatively, if we want to preserve the rn-chat/wocky-client separation, we can declare
persistLog
andnotifyBugsnag
as global functions (and stub them out in testuser.ts)