You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import AWSLambdaEvents
import AWSLambdaRuntime
import AWSLambdaTesting
@testable import <MyLambda Target>
import XCTest
final class MyHandlerTests: XCTestCase {
func testOKResponse() async throws {
let request = APIGatewayV2Request() // Can't create this
let response = try await Lambda.test(MyHandler.self, with: request)
XCTAssertEqual(response.statusCode, .ok)
}
}
SwiftAWSLambdaRuntime version/commit hash
1.0.0-alpha.2
Swift & OS version (output of swift --version && uname -a)
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0
Darwin xxx.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:49 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6020 arm64
The text was updated successfully, but these errors were encountered:
Expected behavior
I'm trying to test a
LambdaHandler
using
Lambda.test(MyHandler.self, with: <APIGatewayV2Request>)
but I can't create an
APIGatewayV2Request
to test with becauseinit
isn't public.Actual behavior
I would expect to be able to create an
APIGatewayV2Request
viainit
or some convenience method so that I can write tests for myLambdaHandler
.Steps to reproduce
LambdaHandler
whoseEvent
is of typeAPIGatewayV2Request
Lambda.test
from theAWSLambdaTesting
library.If possible, minimal yet complete reproducer code (or URL to code)
Handler
Test
SwiftAWSLambdaRuntime version/commit hash
1.0.0-alpha.2
Swift & OS version (output of
swift --version && uname -a
)The text was updated successfully, but these errors were encountered: