I’m really enjoying React for Real so far, but I ran into an issue people may run into in Chapter 4. I received an error that looked like the following:
Determining test suites to run...Error: This promise must be present when running with -o. at /Users/kelcecil/code/react-for-real/wordcounter-single/node_modules/jest/node_modules/jest-cli/build/search_source.js:192:17 at Generator.next (<anonymous>) at step (/Users/kelcecil/code/react-for-real/wordcounter-single/node_modules/jest/node_modules/jest-cli/build/search_source.js:20:362) ...
There appears to be a bug in Jest v21.0.1 where you’ll see this error if you run
jest --watch in a directory without a git metadata (
.git) directory. You can workaround by running
git init in your project directory to create the git metadata directory or by downgrading Jest to v20.0.4.
You can follow the relevant bug report at Github. Hope this helps!