From baff8ad6ee1ffb6c8b68dd99710b683e36caf20f Mon Sep 17 00:00:00 2001 From: Dhiogo Ramos Brustolin Date: Tue, 15 Nov 2022 15:34:51 +0100 Subject: [PATCH 1/2] Update SentrySerializationTests.swift --- Tests/SentryTests/Helper/SentrySerializationTests.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tests/SentryTests/Helper/SentrySerializationTests.swift b/Tests/SentryTests/Helper/SentrySerializationTests.swift index 2e86290e25d..0fed1e2741b 100644 --- a/Tests/SentryTests/Helper/SentrySerializationTests.swift +++ b/Tests/SentryTests/Helper/SentrySerializationTests.swift @@ -18,8 +18,10 @@ class SentrySerializationTests: XCTestCase { do { data = try SentrySerialization.data(withJSONObject: json) } catch { + //Depending of the iOS version, the underlying type of NSDate may change. + let dateType = NSStringFromClass(type(of: NSDate())) exp.fulfill() - XCTAssertEqual(error.localizedDescription, "Event cannot be converted to JSON (Invalid type in JSON write (__NSTaggedDate))") + XCTAssertEqual(error.localizedDescription, "Event cannot be converted to JSON (Invalid type in JSON write (\(dateType)))") } waitForExpectations(timeout: 1) XCTAssertNil(data) From edae8ff9d21a39b12b980517b1da0c44e4440aac Mon Sep 17 00:00:00 2001 From: Dhiogo Ramos Brustolin Date: Tue, 15 Nov 2022 16:09:22 +0100 Subject: [PATCH 2/2] Update SentrySerializationTests.swift --- Tests/SentryTests/Helper/SentrySerializationTests.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/SentryTests/Helper/SentrySerializationTests.swift b/Tests/SentryTests/Helper/SentrySerializationTests.swift index 0fed1e2741b..edba69ed866 100644 --- a/Tests/SentryTests/Helper/SentrySerializationTests.swift +++ b/Tests/SentryTests/Helper/SentrySerializationTests.swift @@ -18,10 +18,10 @@ class SentrySerializationTests: XCTestCase { do { data = try SentrySerialization.data(withJSONObject: json) } catch { - //Depending of the iOS version, the underlying type of NSDate may change. - let dateType = NSStringFromClass(type(of: NSDate())) exp.fulfill() - XCTAssertEqual(error.localizedDescription, "Event cannot be converted to JSON (Invalid type in JSON write (\(dateType)))") + //Depending of the iOS version, the underlying type of NSDate may change. + //Knowing that we have an error is enough. + XCTAssertTrue(error.localizedDescription.starts(with: "Event cannot be converted to JSON (Invalid type in JSON write")) } waitForExpectations(timeout: 1) XCTAssertNil(data)