From 58f4e236a5e1c16686722c5a9b65d4532abcb9d0 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Fri, 25 Aug 2023 14:31:08 -0800 Subject: [PATCH] make test non-crashing if assertion fails --- .../Breadcrumbs/SentryBreadcrumbTrackerTests.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tests/SentryTests/Integrations/Breadcrumbs/SentryBreadcrumbTrackerTests.swift b/Tests/SentryTests/Integrations/Breadcrumbs/SentryBreadcrumbTrackerTests.swift index 212fd1a31f9..ff87d0aad6d 100644 --- a/Tests/SentryTests/Integrations/Breadcrumbs/SentryBreadcrumbTrackerTests.swift +++ b/Tests/SentryTests/Integrations/Breadcrumbs/SentryBreadcrumbTrackerTests.swift @@ -48,7 +48,10 @@ class SentryBreadcrumbTrackerTests: XCTestCase { let crumbs = delegate.addCrumbInvocations.invocations // one breadcrumb for starting the tracker, and a second one for the swizzled viewDidAppear - XCTAssertEqual(2, crumbs.count) + guard crumbs.count == 2 else { + XCTFail("Expected exactly 2 breadcrumbs") + return + } let lifeCycleCrumb = crumbs[1] XCTAssertEqual("navigation", lifeCycleCrumb.type)