DEV Community

Amritesh
Amritesh

Posted on

Facing issue with jest working with Node18 for react

I am upgrading my code from node14 to node18 written for a react app.
I tried mocking an api call and tried to mount it with Provider but the error comes that api call is undefined this results in error from my file.
I get error like

getData)(argument).then(res => {
                ^
TypeError: Cannot read properties of undefined (reading 'then')
Enter fullscreen mode Exit fullscreen mode

Also after upgrading, jest is not able to find other test files.

Top comments (0)