Skip to content

Commit

Permalink
Clean up trailing whitespace for swiftlint compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
jdjackson committed Dec 18, 2024
1 parent e202122 commit 3249ac6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Tests/CrashesTests/CrashCollectionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class CrashCollectionTests: XCTestCase {
let crashCollection = CrashCollection(crashReportSender: crashReportSender,
crashCollectionStorage: store)
let expectation = self.expectation(description: "Crash collection response")

// Set up closures on our CrashCollection object
crashCollection.start(process: {_ in
return ["fake-crash-data".data(using: .utf8)!] // Not relevant to this test
Expand All @@ -122,19 +122,19 @@ class CrashCollectionTests: XCTestCase {
MXCrashDiagnostic()
])
])

self.wait(for: [expectation], timeout: 3)

XCTAssertEqual(store.object(forKey: CRCIDManager.crcidKey) as! String, "", "CRCID should not be present in the store after receiving a successful response")
}

func testCRCIDIsRetainedWhenServerErrorIsReceived() {
let store = MockKeyValueStore()
let crashReportSender = MockCrashReportSender(platform: .iOS, pixelEvents: nil)
let crashCollection = CrashCollection(crashReportSender: crashReportSender,
crashCollectionStorage: store)
let expectation = self.expectation(description: "Crash collection response")

// Set up closures on our CrashCollection object
crashCollection.start(process: {_ in
return ["fake-crash-data".data(using: .utf8)!] // Not relevant to this test
Expand All @@ -154,9 +154,9 @@ class CrashCollectionTests: XCTestCase {
MXCrashDiagnostic()
])
])

self.wait(for: [expectation], timeout: 3)

XCTAssertEqual(store.object(forKey: CRCIDManager.crcidKey) as? String, crcid)
}
}
Expand All @@ -180,7 +180,7 @@ class MockPayload: MXDiagnosticPayload {
}

class MockCrashReportSender: CrashReportSending {

let platform: CrashCollectionPlatform
var responseCRCID: String?
var responseStatusCode = 200
Expand All @@ -190,13 +190,13 @@ class MockCrashReportSender: CrashReportSending {
required init(platform: CrashCollectionPlatform, pixelEvents: EventMapping<CrashReportSenderError>?) {
self.platform = platform
}

func send(_ crashReportData: Data, crcid: String?, completion: @escaping (_ result: Result<Data?, Error>, _ response: HTTPURLResponse?) -> Void) {
var responseHeaderFields: [String: String] = [:]
if let responseCRCID {
responseHeaderFields[CrashReportSender.httpHeaderCRCID] = responseCRCID
}

guard let response = HTTPURLResponse(url: URL(string: "fakeURL")!,
statusCode: responseStatusCode,
httpVersion: nil,
Expand Down

0 comments on commit 3249ac6

Please sign in to comment.