你好,我正在使用 esm 和 jest 运行 typescript,但 middy 遇到问题:
\n我做了这个测试:
\nimport { APIGatewayEvent, Context } from \'aws-lambda\';\nimport { lambda } from \'../index.js\';\n\ndescribe(\'get-by-id handler\', () => {\n test(\'Should not find id\', async () => {\n const x = jest.fn();\n x();\n expect(x).toHaveBeenCalled();\n });\n});\nRun Code Online (Sandbox Code Playgroud)\n它与我在下面提供的配置和npm run test命令配合得很好。\n但是当我将其更改为如下所示时:
import { APIGatewayEvent, Context } from \'aws-lambda\';\nimport { lambda } from \'../index.js\';\n\ndescribe(\'get-by-id handler\', () => {\n test(\'Should not find id\', async () => {\n const res = await lambda({\n pathParameters: { …Run Code Online (Sandbox Code Playgroud)