node -v: v8.1.0 or v6.10.2npm -v: 5.0.3 or v5.4.1npm ls react-scripts (if you haven鈥檛 ejected): (empty)
Operating system: MacOS Sierra 10.12.6
Error: This promise must be present when running with -o.
at /Project/node_modules/jest/node_modules/jest-cli/build/search_source.js:203:17
at Generator.next (<anonymous>)
at step (/Project/node_modules/jest/node_modules/jest-cli/build/search_source.js:20:362)
at /Project/node_modules/jest/node_modules/jest-cli/build/search_source.js:20:592
at Promise (<anonymous>)
at /Project/node_modules/jest/node_modules/jest-cli/build/search_source.js:20:273
at SearchSource.getTestPaths (/Project/node_modules/jest/node_modules/jest-cli/build/search_source.js:217:10)
at /Project/node_modules/jest/node_modules/jest-cli/build/run_jest.js:45:29
at Generator.next (<anonymous>)
at step (/Project/node_modules/jest/node_modules/jest-cli/build/run_jest.js:24:380)
Work. Like it does when using latest jest v20
Does not works, does nothing.
This might be fixed by #146
@orta @drpicox I had the same issue. From this thread it seems like this is a problem whenever you don't have git yet in the project. Indeed setting the watchAll instead of watch flag helped, but better yet I've just initialized git repo and it worked well (I would need to do this anyways). Dunno if it's something you can fix on your end as they still have opened PRs, though.
I think letting jest handle this is probably a good 馃憤 - or it can be added to jest-editor-support
@sunshinejr, you should be able to run with --watchAll by just customizing the jest.pathToJest option (in vscode's settings) or the npm script it points to. for example: "jest.pathToJest": "node_modules/.bin/jest --watchAll"
vscode-jest would run the command first time as it is (without appending the --watch flag), so it should pick up your --watchAll flag. Since --watchAll will not exit, vscode-jest will just never go into its normal --watch mode. But everything should function just fine.
Anyway, I agree with @orta that if the issue is caused by jest, it is best for the jest team to fix the root cause. Hopefully, the --watchAll will get you around this problem until jest is fixed.
Right, sorry if my message wasn't clear, this is exactly what I wanted to say with Jest having opened PRs for the fix 馃憤
@sunshinejr, thanks for pointing at using the --watchAll flag. I experienced the same issue working on Windows 10 with Jest v21.2.1 and solved it that way.
It seems to have been fixed in #4737 but not yet released.
This is going against my "wontfix" label, but since the UI still gets stuck at "testing changes" is it worth:
--watchAll
Most helpful comment
@orta @drpicox I had the same issue. From this thread it seems like this is a problem whenever you don't have
gityet in the project. Indeed setting thewatchAllinstead ofwatchflag helped, but better yet I've just initializedgitrepo and it worked well (I would need to do this anyways). Dunno if it's something you can fix on your end as they still have opened PRs, though.