@tsed/platform-serverless-testing
Version:
Module to test Serverless function with Ts.ED
16 lines (14 loc) • 380 B
text/typescript
import type {Context} from "aws-lambda";
export function createFakeContext(context?: Context): Context {
return {
awsRequestId: "awsRequestId",
callbackWaitsForEmptyEventLoop: false,
functionName: "",
functionVersion: "",
invokedFunctionArn: "",
logGroupName: "",
logStreamName: "",
memoryLimitInMB: "",
...(context || {})
} as Context;
}