sentry-docs icon indicating copy to clipboard operation
sentry-docs copied to clipboard

Document how the mobile SDKs can be tested through mocks/fakes.

Open romtsn opened this issue 2 years ago • 5 comments

Core or SDK?

Platform/SDK

Which part? Which one?

Mobile

Description

We do not document very well how to test our mobile SDKs, e.g. to assert if the event has been captured by Sentry. (a recent issue https://github.com/getsentry/sentry-java/issues/2651, dart - https://github.com/getsentry/sentry-dart/issues/1380).

Suggested Solution

We could provide a simple section in docs which describes different strategies of capturing/asserting events, e.g. using beforeSend or bindClient on some platforms, using a fake DSN, etc. etc.

For React Native we could probably get away with linking to sentry-testkit.

For other platforms we could have a shared docs page with code snippets per platform.

romtsn avatar Apr 19 '23 12:04 romtsn

Routing to @getsentry/team-mobile for triage, due by (sfo). ⏲️

getsantry[bot] avatar Apr 19 '23 12:04 getsantry[bot]

Just to emphasize, this is not just about the mobile/Android SDK, but also when using Sentry in Java and Kotlin applications on the backend. Thanks!

volkert-fastned avatar Apr 19 '23 16:04 volkert-fastned

Let's have a single pseudo-code like code snippet on how this can be done across all SDKs.

markushi avatar Apr 26 '23 14:04 markushi

Since this reused code/docs, no need for all the platform labels.

marandaneto avatar Apr 27 '23 11:04 marandaneto

We could document similar to what docs.sentry.io/platforms/dotnet/guides/aspnetcore/unit-testing has.

Closed https://github.com/getsentry/sentry-java/issues/3050 in favor of this one.

adinauer avatar Nov 27 '23 06:11 adinauer