2

When creating a react-native project from scratch I am getting jest in devDependencies and test passes!

But now I am getting when doing my tests:

(node:32629) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Cannot find module '.../node_modules/jest-cli' (node:32629) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. 

Should I use jest or jest-cli?

1 Answer 1

2

It's hard to know without more information, but it might be that your globally installed jest is older than your packages.json version.

Try running the following from your project directory and compare the results:

jest --version npm exec jest --version 

Also try running npm exec jest as that will run jest using your locally installed version.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.