const invokeApi = require("/opt/nodejs/kiwiCall");\nconst decrypt = require("/opt/nodejs/encryption");\nconst cors = require("/opt/nodejs/cors");\nRun Code Online (Sandbox Code Playgroud)\n\n当我通过手动模拟模拟目录中的这些依赖项来测试我的index.js文件时,如下所示:
\n\n__mocks__ \n |_invokeApi\n |_decrypt\n |_cors\nRun Code Online (Sandbox Code Playgroud)\n\n它说
\n\nFAIL ./index.test.js\n \xe2\x97\x8f Test suite failed to run\n\n Cannot find module \'/opt/nodejs/kiwiCall\' from \'index.js\'\n\n However, Jest was able to find:\n \'../../../../lambdas/Flights/Locations/index.js\'\n\n You might want to include a file extension in your import, or update your \'moduleFileExtensions\', which is currently [\'js\', \'json\', \'jsx\', \'ts\', \'tsx\', \'node\'].\n\n See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string\n\n 1 | "use strict";\n 2 | \n > 3 | …Run Code Online (Sandbox Code Playgroud)