When implementing a lambda in JavaScript with Node 8, the handler can be implemented as an async function. One can then simply return a response (which is passed back to the client when doing RequestResponse-type invocation) or use throw to return an error (see https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-mode-exceptions.html).
lambda-tester currently supports verification of responses and errors when they were returned by calling callback(error, response), but not when a return or throw was used. It would be nice to have support for this, too.
When implementing a lambda in JavaScript with Node 8, the handler can be implemented as an async function. One can then simply return a response (which is passed back to the client when doing RequestResponse-type invocation) or use
throw
to return an error (see https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-mode-exceptions.html).lambda-tester currently supports verification of responses and errors when they were returned by calling
callback(error, response)
, but not when areturn
orthrow
was used. It would be nice to have support for this, too.