UNPKG

@tsed/platform-serverless-testing

Version:
31 lines (30 loc) 812 B
export function createFakeEvent(event = {}) { return { body: "", headers: {}, httpMethod: "", isBase64Encoded: false, multiValueHeaders: {}, multiValueQueryStringParameters: {}, path: event.path || "/", pathParameters: {}, queryStringParameters: {}, resource: "", stageVariables: {}, ...event, requestContext: { ...event?.requestContext, accountId: "", apiId: "", protocol: "https", httpMethod: "", identity: {}, path: event.path || "/", stage: "", requestId: "requestId", requestTimeEpoch: 0, resourceId: 1, resourcePath: event.path || "/" } }; }