File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,27 @@ final class FunctionsClientTests: XCTestCase {
205205 try await sut. invoke ( " hello-world " , options: . init( region: . caCentral1) )
206206 }
207207
208+ func testInvokeWithRegion_usingExpressibleByLiteral( ) async throws {
209+ Mock (
210+ url: url. appendingPathComponent ( " hello-world " ) ,
211+ statusCode: 200 ,
212+ data: [ . post: Data ( ) ]
213+ )
214+ . snapshotRequest {
215+ #"""
216+ curl \
217+ --request POST \
218+ --header "X-Client-Info: functions-swift/0.0.0" \
219+ --header "apikey: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0" \
220+ --header "x-region: ca-central-1" \
221+ "http://localhost:5432/functions/v1/hello-world"
222+ """#
223+ }
224+ . register ( )
225+
226+ try await sut. invoke ( " hello-world " , options: . init( region: " ca-central-1 " ) )
227+ }
228+
208229 func testInvokeWithoutRegion( ) async throws {
209230 region = nil
210231
You can’t perform that action at this time.
0 commit comments