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 @@ -203,6 +203,27 @@ final class FunctionsClientTests: XCTestCase {
203203 try await sut. invoke ( " hello-world " , options: . init( region: . caCentral1) )
204204 }
205205
206+ func testInvokeWithRegion_usingExpressibleByLiteral( ) async throws {
207+ Mock (
208+ url: url. appendingPathComponent ( " hello-world " ) ,
209+ statusCode: 200 ,
210+ data: [ . post: Data ( ) ]
211+ )
212+ . snapshotRequest {
213+ #"""
214+ curl \
215+ --request POST \
216+ --header "X-Client-Info: functions-swift/0.0.0" \
217+ --header "apikey: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0" \
218+ --header "x-region: ca-central-1" \
219+ "http://localhost:5432/functions/v1/hello-world"
220+ """#
221+ }
222+ . register ( )
223+
224+ try await sut. invoke ( " hello-world " , options: . init( region: " ca-central-1 " ) )
225+ }
226+
206227 func testInvokeWithoutRegion( ) async throws {
207228 region = nil
208229
You can’t perform that action at this time.
0 commit comments