getsentry / sentry-docs

Sentry's documentation (and tools to build it)
https://docs.sentry.io
Other
326 stars 1.43k forks source link

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

Open romtsn opened 1 year ago

romtsn commented 1 year ago

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.

getsantry[bot] commented 1 year ago

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

volkert-fastned commented 1 year ago

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!

markushi commented 1 year ago

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

marandaneto commented 1 year ago

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

adinauer commented 9 months ago

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.