Skip to content

Fix test example in Readme #507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,11 @@ your text fixtures into the structures, and call your handler directly:
#[test]
fn test_my_lambda_handler() {
let input = serde_json::from_str("{\"command\": \"Say Hi!\"}").expect("failed to parse event");
let context = lambda_runtime::types::Context::default();
let context = lambda_runtime::Context::default();

let event = lambda_runtime::types::LambdaEvent::new(input, context);
let event = lambda_runtime::LambdaEvent::new(input, context);

my_lambda_handler(event).expect("failed to handle event");
my_lambda_handler(event).await.expect("failed to handle event");
}
```

Expand All @@ -316,7 +316,7 @@ fn test_my_lambda_handler() {
let request = lambda_http::request::from_str(input)
.expect("failed to create request");

let response = my_lambda_handler(request).expect("failed to handle request");
let response = my_lambda_handler(request).await.expect("failed to handle request");
}
```

Expand Down