Skip to content

Commit a4cc68d

Browse files
committed
test: add test for ExpressibleByLiteralString
1 parent aac21e6 commit a4cc68d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Tests/FunctionsTests/FunctionsClientTests.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)