Below settings for my package.json
If I run from command line npm test all jest test cases are executed properly. In case I use directly the command
npm test
npm install react-dev-utils@10.1.0
Installing this version of react-dev-utils helped, when sometimes the commands in the accepted answers didn't.
react-dev-utils
Good luck y'all!