Skip to content

Commit b626efa

Browse files
committed
test: add test for ExpressibleByLiteralString
1 parent f83ccfd commit b626efa

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
@@ -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

0 commit comments

Comments
 (0)