Jest: test suite could not be started, TypeError: cannot read property 'bind' from undefined

we used jokes from unit testing in reaction-native. He worked well. We just uninstalled npm and installed it again, and then when we tried to run unit test (npm test), we get the following error, and we cannot run test cases.

enter image description here

What could have gone wrong.

+5
source share
4 answers

Updating the jest-cli version from 18 to 19 fixed the problem.

Problem in github repo jest

0
source

I had the same problem. I started with a couple of tests using only jokes, then I initialized the folder using the create-response-app on another machine and restored the previous tests. After that, I switched to my current machine, installed npm and ran tests. This gave me this error, so I uninstalled node_modules and installed npm again. All tests are now green.

0
source

Try reinstalling the latest versions of jest and jest babel

npm install --save-dev jest

npm install --save-dev babel-jest regenerator-runtime

And restart the test, it works for me

0
source

I had the same error:

 Test suite failed to run, TypeError: Cannot read property 'bind' of undefined 

Like @Harish_N, but I used reaction scripts.

In my case, it was all about updating test dependencies to a newer version in package.json .

0
source

Source: https://habr.com/ru/post/1265224/


All Articles