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.