Add tests for the Native Bridges
RNSentry.m has no tests. We could add a layer of abstraction, unit tests in Swift and run them in CI to validate its functionality.
also for Android, so I made it more generic, thanks.
I wouldn't mind having two issues and / or two PRs so they get merged faster.
I don't disagree with the issue but worth mentioning that unit testing this has limited value as compared to an integration test. That's because this type is called by React Native (RCT_EXPORT_METHOD) and the type marshaling plays a role here too. Additionally, there's very little logic.
I believe some pieces could be unit tested but indeed, integration/e2e would play a bigger role.
Integration tests make more sense because even if the unit tests are green the functionality could be broken because the underlying functionality changed.
- iOS native tests added in https://github.com/getsentry/sentry-react-native/pull/2707
- Android native tests added in https://github.com/getsentry/sentry-react-native/pull/3170