Skip to content

Commit 22c210e

Browse files
committed
add test for nativeCrash
1 parent 59341c4 commit 22c210e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

flutter/lib/src/sentry_flutter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ mixin SentryFlutter {
275275

276276
/// Use `nativeCrash()` to crash the native implementation and test/debug the crash reporting for native code.
277277
/// This should not be used in production code.
278-
/// Only for Android and iOS
278+
/// Only for Android, iOS and macOS
279279
static Future<void> nativeCrash() {
280280
if (_native == null) {
281281
_logNativeIntegrationNotAvailable("nativeCrash");

flutter/test/sentry_native_channel_test.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,15 @@ void main() {
302302

303303
verify(channel.invokeMethod('resumeAppHangTracking'));
304304
});
305+
306+
test('nativeCrash', () async {
307+
when(channel.invokeMethod('nativeCrash'))
308+
.thenAnswer((_) => Future.value());
309+
310+
await sut.nativeCrash();
311+
312+
verify(channel.invokeMethod('nativeCrash'));
313+
});
305314
});
306315
}
307316
}

0 commit comments

Comments
 (0)