Within my Typescript code, I have a function defined as follows:
export const func: AWSLambda.APIGatewayProxyHandler = async (
arg
): Promise<AWSLambda.APIGatewayProxyResult> => {
During a unit test, when I attempt to call this function like func(param1)
, I encounter an error message stating
Expected 3 arguments, but got 1. handler.d.ts(86,5): An argument for 'context' was not provided.
I am puzzled by why it is expecting 3 arguments when the function header clearly specifies only one argument. Could this discrepancy be related to AWSLambda.APIGatewayProxyHandler
or
Promise<AWSLambda.APIGatewayProxyResult>
?