Skip to content

Commit 45a1c3f

Browse files
minor: set environment variable if needed in lambda test
1 parent 9a703c1 commit 45a1c3f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/test/lambda_examples/no_auth.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ async fn test_handler() {
4646
if std::env::var("MONGODB_API_VERSION").is_ok() {
4747
return;
4848
}
49+
if std::env::var("MONGODB_URI").is_err() {
50+
std::env::set_var("MONGODB_URI", "mongodb://localhost:27017");
51+
}
4952
let event = LambdaEvent::new(Value::Null, Default::default());
5053
handler(event).await.unwrap();
5154
}

0 commit comments

Comments
 (0)