Error: This promise must be present when running with -o
See original GitHub issueEnvironment
-
node -v
: v8.1.0 or v6.10.2 -
npm -v
: 5.0.3 or v5.4.1 -
npm ls react-scripts
(if you haven’t ejected): (empty) -
Operating system: MacOS Sierra 10.12.6
-
Jest version: v21.1.0
-
vscode-jest version: 2.3.0
Steps to Reproduce
- Create an empty project.
- Install locally Jest v21.1.0
- Creater some.spec.js that just asserts true equals true
- Restart VS Code
- Go to Jest output, it shows this:
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)
Expected Behavior
Work. Like it does when using latest jest v20
Actual Behavior
Does not works, does nothing.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:18
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Jest test fails when trying to test an asynchronous function ...
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not...
Read more >Error handling with promises - The Modern JavaScript Tutorial
In case of an error, the promise becomes rejected, and the execution should jump to the closest rejection handler. But there is none....
Read more >Mocha - the fun, simple, flexible JavaScript test framework
Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun. Mocha tests run...
Read more >Troubleshooting - Jest
This will run Jest in a Node process that an external debugger can ... will give you a list of available node instances...
Read more >Promise.reject() - JavaScript - MDN Web Docs
Promise.reject(new Error('fail')).then(resolved, rejected);. 10. // expected output: Error: fail. 11. . Run ›
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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 thewatchAll
instead ofwatch
flag helped, but better yet I’ve just initializedgit
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.@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.