@@ -608,7 +608,7 @@ class SentrySDKInternalTests: XCTestCase {
608608#endif
609609
610610 @available ( * , deprecated, message: " This is deprecated because SentryOptions integrations is deprecated " )
611- func testResumeAndPauseAppHangTracking( ) {
611+ func testResumeAndPauseAppHangTracking( ) throws {
612612 SentrySDK . start { options in
613613 options. dsn = SentrySDKInternalTests . dsnAsString
614614 options. setIntegrations ( [ SentryANRTrackingIntegration . self] )
@@ -617,7 +617,7 @@ class SentrySDKInternalTests: XCTestCase {
617617 let client = fixture. client
618618 SentrySDKInternal . currentHub ( ) . bindClient ( client)
619619
620- let anrTrackingIntegration = SentrySDKInternal . currentHub ( ) . getInstalledIntegration ( SentryANRTrackingIntegration . self)
620+ let anrTrackingIntegration = try XCTUnwrap ( SentrySDKInternal . currentHub ( ) . getInstalledIntegration ( SentryANRTrackingIntegration . self) )
621621
622622 SentrySDK . pauseAppHangTracking ( )
623623 Dynamic ( anrTrackingIntegration) . anrDetectedWithType ( SentryANRType . unknown)
@@ -629,7 +629,7 @@ class SentrySDKInternalTests: XCTestCase {
629629 if SentryDependencyContainer . sharedInstance ( ) . crashWrapper. isBeingTraced {
630630 XCTAssertEqual ( 0 , client. captureEventWithScopeInvocations. count)
631631 } else {
632- XCTAssertEqual ( 1 , client. captureEventWithScopeInvocations. count)
632+ XCTAssertEqual ( 1 , client. captureEventWithScopeInvocations. count, " The SDK should capture an AppHang after resuming the tracking, but it didn't. " )
633633 }
634634 }
635635
0 commit comments