Closed
Description
How do test the lambda given the example below? According to test functions, main
does not exist.
use lambda::{lambda, Context};
use serde_json::Value;
type Error = Box<dyn std::error::Error + Send + Sync + 'static>;
#[lambda]
#[tokio::main]
async fn main(event: Value, _: Context) -> Result<Value, Error> {
Ok(event)
}
#[cfg(test)]
mod tests {
use serde_json::json;
use super::*;
#[test]
fn test_lambda_handler() {
let payload = json!({
"val1": true,
"val2": 42,
"val3": "hello"
});
//
// W H A T G O E S H E R E ?
//
}
}