Skip to content

Add tests for logError thread-safety / Make it return a value #259

Description

@mokagio

See @salimbraksa's comment from Jetpack and WordPress iOS: https://github.com/wordpress-mobile/WordPress-iOS/pull/20846/files#r1231271865

I could only find one usage of logError in the tests, and is commented:

///
/// These are currently disabled, but are being left here, because I'm hoping to get
/// back to this and sort out how to send stack traces for these events.
///
// func testThatLoggedErrorsContainAStackTrace() {
// let expectation = XCTestExpectation(description: "Event should contain a Stack Trace")
//
// mockDataProvider.didLogErrorCallback = { event in
// expectation.isInverted = event.stacktrace == nil // fail if `stacktrace` is nil
// expectation.fulfill()
// }
//
// CrashLogging.start(withDataProvider: mockDataProvider)
// CrashLogging.logError("This is a test")
//
// wait(for: [expectation], timeout: 1)
// }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions