@@ -25,7 +25,7 @@ final class FunctionsClientTests: XCTestCase {
25
25
XCTAssertEqual ( client. region, " sa-east-1 " )
26
26
27
27
XCTAssertEqual ( client. headers [ . init( " Apikey " ) !] , apiKey)
28
- XCTAssertNotNil ( client. headers [ . init ( " X-Client-Info " ) ! ] )
28
+ XCTAssertNotNil ( client. headers [ . xClientInfo ] )
29
29
}
30
30
31
31
func testInvoke( ) async throws {
@@ -49,17 +49,21 @@ final class FunctionsClientTests: XCTestCase {
49
49
50
50
try await sut. invoke (
51
51
" hello_world " ,
52
- options: . init( headers: [ " X-Custom-Key " : " value " ] , body: body)
52
+ options: . init(
53
+ headers: [ " X-Custom-Key " : " value " ] ,
54
+ body: body
55
+ )
53
56
)
54
57
55
- guard let request = await http. receivedRequests. last else { return }
56
-
58
+ let _request = await http. receivedRequests. last
59
+ let request = try XCTUnwrap ( _request)
60
+
57
61
XCTAssertEqual ( request. request. url, url)
58
62
XCTAssertEqual ( request. request. method, . post)
59
63
XCTAssertEqual ( request. request. headerFields [ . init( " Apikey " ) !] , apiKey)
60
64
XCTAssertEqual ( request. request. headerFields [ . init( " X-Custom-Key " ) !] , " value " )
61
65
XCTAssertEqual (
62
- request. request. headerFields [ . init ( " X-Client-Info " ) ! ] ,
66
+ request. request. headerFields [ . xClientInfo ] ,
63
67
" functions-swift/ \( Functions . version) "
64
68
)
65
69
}
0 commit comments