在我运行之前,我的 react 应用程序运行良好npm audit fix
。我现在收到一个错误:
Test suite failed to run
Cannot find module 'date-fns/addDays' from 'date-fns-utils.js'
However, Jest was able to find:
'./index.css'
'./index.js'
'./index.test.js'
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently
['web.js', 'js', 'web.ts', 'ts', 'web.tsx', 'tsx', 'json', 'web.jsx', 'jsx', 'node'].
在其中一项测试中npm test
这可能是什么?让我知道我需要添加哪些细节。谢谢!