Skip to content

Commit 50c0e53

Browse files
author
Ignacio Bonafonte
authored
Merge branch 'main' into bugfix/requestMapAccess
2 parents 97af11e + 334f00a commit 50c0e53

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Tests/ExportersTests/DatadogExporter/Upload/DataUploadWorkerTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class DataUploadWorkerTests: XCTestCase {
9191
featureName: .mockAny()
9292
)
9393

94-
wait(for: [startUploadExpectation], timeout: 0.5)
94+
wait(for: [startUploadExpectation], timeout: 1)
9595
worker.cancelSynchronously()
9696

9797
// Then
@@ -117,7 +117,7 @@ class DataUploadWorkerTests: XCTestCase {
117117
featureName: .mockAny()
118118
)
119119

120-
wait(for: [startUploadExpectation], timeout: 0.5)
120+
wait(for: [startUploadExpectation], timeout: 1)
121121
worker.cancelSynchronously()
122122

123123
// Then

Tests/ExportersTests/DatadogExporter/Utils/EncodableValueTests.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import XCTest
99
class EncodableValueTests: XCTestCase {
1010
func testItEncodesDifferentEncodableValues() throws {
1111
let encoder = JSONEncoder()
12+
encoder.outputFormatting = .sortedKeys
1213

1314
XCTAssertEqual(
1415
try encoder.encode(EncodingContainer(EncodableValue("string"))).utf8String,
@@ -42,29 +43,30 @@ class EncodableValueTests: XCTestCase {
4243
class JSONStringEncodableValueTests: XCTestCase {
4344
func testItEncodesDifferentEncodableValuesAsString() throws {
4445
let encoder = JSONEncoder()
46+
encoder.outputFormatting = .sortedKeys
4547

4648
XCTAssertEqual(
4749
try encoder.encode(
48-
EncodingContainer(JSONStringEncodableValue("string", encodedUsing: JSONEncoder()))
50+
EncodingContainer(JSONStringEncodableValue("string", encodedUsing: encoder))
4951
).utf8String,
5052
#"{"value":"string"}"#
5153
)
5254
XCTAssertEqual(
5355
try encoder.encode(
54-
EncodingContainer(JSONStringEncodableValue(123, encodedUsing: JSONEncoder()))
56+
EncodingContainer(JSONStringEncodableValue(123, encodedUsing: encoder))
5557
).utf8String,
5658
#"{"value":"123"}"#
5759
)
5860
XCTAssertEqual(
5961
try encoder.encode(
60-
EncodingContainer(JSONStringEncodableValue(["a", "b", "c"], encodedUsing: JSONEncoder()))
62+
EncodingContainer(JSONStringEncodableValue(["a", "b", "c"], encodedUsing: encoder))
6163
).utf8String,
6264
#"{"value":"[\"a\",\"b\",\"c\"]"}"#
6365
)
6466
XCTAssertEqual(
6567
try encoder.encode(
6668
EncodingContainer(
67-
JSONStringEncodableValue(URL(string: "https://example.com/image.png")!, encodedUsing: JSONEncoder())
69+
JSONStringEncodableValue(URL(string: "https://example.com/image.png")!, encodedUsing: encoder)
6870
)
6971
).utf8String,
7072
#"{"value":"https:\/\/example.com\/image.png"}"#
@@ -75,7 +77,7 @@ class JSONStringEncodableValueTests: XCTestCase {
7577
}
7678
XCTAssertEqual(
7779
try encoder.encode(
78-
EncodingContainer(JSONStringEncodableValue(Foo(), encodedUsing: JSONEncoder()))
80+
EncodingContainer(JSONStringEncodableValue(Foo(), encodedUsing: encoder))
7981
).utf8String,
8082
#"{"value":"{\"bar\":\"bar_\",\"bizz\":\"bizz_\"}"}"#
8183
)

0 commit comments

Comments
 (0)