最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - React-Jest error: node:internalprocesspromises:288 triggerUncaughtException(err, true * fromPromise *); TypeError -

programmeradmin0浏览0评论

The exact error is as follows:

node:internal/process/promises:288 
          triggerUncaughtException(err, true /* fromPromise */); 
TypeError: (0, _MyApp.getDataInfo) is not a function

This error occurs when I do

npm test

npm version: 8.19.2 node version: v18.12.1

This error started to occur when I upgraded my existing code from node14 to node18. npm test in package.json: react-scripts test --runInBand --detectOpenHandles

jest version: ^28.1.1 react-script: ^5.0.0

Tried adding async and await in multiple test cases but that didn't work.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论